Mac OS X Terminal的Python raw_input()限制? [英] Python raw_input() limit with Mac OS X Terminal?
问题描述
我编写了一个python脚本,并已使用python2.6在Mac OS X雪豹的终端上运行它.我在多个位置使用raw_input()导入文本,但似乎已达到极限,不再接受任何字符.
这是python raw_input()的限制吗,还是与Terminal或Mac OSX有关?
是否有更好的方法让用户在python中输入大量文本?
我想说这是OSX终端的局限性/错误-尝试通过IDLE输入运行脚本,看看是否仍然遇到相同的问题./p>
关于处理大量输入的更好方法-完全取决于您的要求,但有些方法可能是:
- 从文件导入文本
- 创建某种类型的GUI/前端以通过更加用户友好的控件来处理文本输入
I wrote a python script and have been running it in terminal on Mac OS X snow leopard using python2.6. I used raw_input() to import text in several places, but I seem to reach a limit where it will no longer accept any more characters.
Is this a limit in python raw_input() or is this something to do with Terminal or Mac OSX?
Is there a better way to have the user input larger amounts of text in python?
I'd say it's a limitation/bug with the OSX Terminal - try running the script with input via IDLE and see whether you still hit the same problem.
As for better ways of dealing with large input - it totally depends on your requirements but some ways could be:
- Import text from a file
- Create some kind of GUI/frontend to handle text input via more user friendly controls
这篇关于Mac OS X Terminal的Python raw_input()限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!