Python 3.1 和 Sublime Text 2 错误
我想使用 SublimeText2 作为 IDE 来开发 Python 应用程序。
我有以下问题:
当我创建一个新文件时,将其另存为 python 并执行 Tools ->构建系统-> Python CTRL + B
我收到此错误:
Please type your name and press enter: Traceback (most recent call last):
File "/Users/strielok/Desktop/hello.py", line 1, in <module>
personsname = raw_input("Please type your name and press enter: ")
EOFError: EOF when reading a line
[Finished]
这是程序的代码:
personsname = raw_input("Please type your name and press enter: ")
print "Hello " +personsname
但是,当我从终端(我在 Mac 上)运行此代码时,它运行良好。
知道可能是什么问题吗?
I want to use a SublimeText2 as IDE for developing applications in Python.
I have the following problem :
When I make a new file, save it as a python and do Tools -> Build System -> Python
CTRL + B
I get this error:
Please type your name and press enter: Traceback (most recent call last):
File "/Users/strielok/Desktop/hello.py", line 1, in <module>
personsname = raw_input("Please type your name and press enter: ")
EOFError: EOF when reading a line
[Finished]
Here is the code of the program:
personsname = raw_input("Please type your name and press enter: ")
print "Hello " +personsname
However when I run this code from terminal (I am on Mac), it works perfectly.
Any idea what the problem might be ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
安装 sublimeREPL,然后选择
Tools->sublimerepl->python
。参考:http://gimo.me/sublime-text2-skills/
Install sublimeREPL and then choose
Tools->sublimerepl->python
.Reference:http://gimo.me/sublime-text2-skills/
取自 Sublime Text 的论坛,似乎 stdin 不会与任何东西连接,所以这是预期的。
来源:http://www.sublimetext.com/forum/viewtopic.php?f=3&t=1519&p=6908&hilit=python+input#wrap
Taken from Sublime Text's forums, seems that stdin will not be connected with anything so it's expected.
Source: http://www.sublimetext.com/forum/viewtopic.php?f=3&t=1519&p=6908&hilit=python+input#wrap
我写了一个插件,它允许在 sublime text 中构建来接受输入。它的边缘有点粗糙,但它可以在我的机器上运行。
I've written a plugin which allows builds in sublime text to take input. It's a bit rough around the edges, but it works on my machine.