Is there a new/updated Twill?
Asked Answered
S

4

10

I've been trying to learn Twill Scripting on Python and I am using Python 3.4 and Twill 1.8.0. Been reading some posts here and I found it interesting to study. But, I do have a problem installing Twill. I just knew that PRINT in Python is now a function so meaning it needs parenthesis and that's where my problem starts. As I look through the codes on Twill 1.8.0, I think it isn't oriented with the change of using PRINT yet. Strings are not enclosed with parenthesis so I was thinking maybe there is a new patch or version of Twill that adapts the changes of Python, is there any? or is there anything I can do about this aside from manually editing Twill files?

Your response is highly appreciated.

Scribble answered 5/6, 2014 at 8:27 Comment(1)
I think it's a legitimate question whether Twill is available for Python3. Upvoted to cancel out the malicious downvote.Bestialize
S
3

I just found the answer. Thanks for viewing this question and probably for that downvote (SAD FACE).. So, the solution that I found was to use the 2to3 Script Tool found in Python Folder. Basically, it refactors Python 2 codes to Python 3 codes.

Scribble answered 5/6, 2014 at 8:50 Comment(2)
I tried that too and could successfully install Twill 1.8.0. But when I try to from twill.commands import *, I get a ModuleNotFoundError: No module named 'lxml'. I use Python 3.6. How did you deal with that?Northumberland
Actually, I could resolve the ModuleNotFoundError by installing lxml and requests with pip install. But now I get a SyntaxError when I try to import because somewhere False = 0....Northumberland
N
3

GMs answer only partly solved the problem for me (using Python 3.6 on Windows). Downloading Twill 1.8.0 and converting it with 2to3 was only the first step.

Afterwards, I had to install missing packages:

pip install lxml
pip install requests
pip install pypiwin32
pip install cssselect

Furthermore, I had to fix two files in Python36/lib/site-packages/twill/other_packages/: In subprocess.py, I removed the section with False = 0 at line 392 and changed if 0: to if 1: in line 353 to avoid using _subprocess. Finally, in pyparsing.py, I replaced .lowercase with .lower() and .uppercase with .upper().

Northumberland answered 2/8, 2017 at 11:44 Comment(0)
V
2

Well, Twill 2.0 is released with support of the modern python revisions

Twill 2.0 Release Info Page

Well, Twill 3 is also here - Twill 3

Vermiculite answered 10/4, 2020 at 20:5 Comment(1)
Quick update: Current versions are now Twill 2.0.3 (Python 2 + 3) and Twill 3.0 (Python 3 only).Horner
I
1

Have you tried to install twill3?

pip install twill3
Inaccurate answered 8/3, 2020 at 11:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.