python twisted stdio example on windows doesn't work

依然范特西╮ 提交于 2020-01-03 17:08:03

问题


I started playing with python/twisted but when I test the stdin example on Windows from cmd.exe, the example doesn't work. I'm using python 2.7 and twisted 12.1.0 (binary msi package). I hoped it was a buffering problem, so I tried also running the script with "python -u stdin.y", but nothing changed.

Obviously, this script works on Linux and on OS X.


回答1:


There is already an open Twisted ticket to make twisted.internet.stdio work on the console in Windows. There's even a fair amount of code associated with this ticket, and a huge amount of diagnosis.

In short, the Windows command-line is a huge mess. It's not even that it's a different interface than the POSIX standard command line; it's a completely different kind of thing. On Linux or OS X, the console is like a tiny, fake teletype that you send bytes and control codes to. On Windows, the console is more like a tiny, fake computer running DOS that you write to the video memory of.

Nevertheless, feel free to help out on that ticket! It could use some more interest!



来源:https://stackoverflow.com/questions/11443040/python-twisted-stdio-example-on-windows-doesnt-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!