我刚刚安装成功TWILL https://web.archive.org/web/20180904160747/http://twill.idyll.org:80/在“StackOverflow”一位非常支持的成员的帮助下在我的计算机上(你可以查看HERE https://stackoverflow.com/questions/2651334/how-can-i-start-using-twill)并尝试运行斜纹文档页面上的简单示例之一(您可以看到该页面HERE https://web.archive.org/web/20180903115044/http://twill.idyll.org:80/examples.html)。这是这个例子:
(source: narod.ru http://roundcan.narod.ru/some_pics/19.jpg)
假设我的用户名是www.slash.org https://web.archive.org/web/20160307172942/http://slash.org/ is lynxye我的密码是mammal。
当我尝试在 Python 提示符中输入该示例代码时,我只能键入并输入代码的第一行,因为当我单击“Enter”开始新行时,我会立即收到一些错误消息:
(source: narod.ru http://roundcan.narod.ru/some_pics/20.jpg)
当我尝试将此代码输入终端时,也会发生同样的情况:
(source: narod.ru http://roundcan.narod.ru/some_pics/21.jpg)
我想我在这里错过了一些基础知识。也许,我需要创建一个包含该代码的文件,然后以某种方式运行该文件,但我真的不知道需要在哪里创建该文件以及使用什么扩展名。
有人可以帮我解决这个问题吗?
您需要在 twill shell 中运行这些命令,而不是 python shell
D:\tmp\twill-0.9>python twill-sh
-= Welcome to twill! =-
current page: *empty page*
>>
当你看到时,你可以输入斜纹命令>>
或者 twill-sh 文件中只有 2 行
import twill.shell
twill.shell.main()
您只需将这两行复制粘贴到 python 提示符中即可。
>>> import twill.shell
>>> twill.shell.main()
-= Welcome to twill! =-
current page: *empty page*
>> ?
Undocumented commands:
======================
add_auth fa info save_html title
add_extra_header find load_cookies setglobal url
agent follow notfind setlocal
back formaction redirect_error show
clear_cookies formclear redirect_output show_cookies
clear_extra_headers formfile reload show_extra_headers
code formvalue reset_browser showforms
config fv reset_error showhistory
debug get_browser reset_output showlinks
echo getinput run sleep
exit getpassword runfile submit
extend_with go save_cookies tidy_ok
current page: *empty page*
>>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)