1

我想使用 SublimeText2 作为 IDE 在 Python 中开发应用程序。

我有以下问题:

当我创建一个新文件时,将其保存为 python 并执行 Tools -> Build System -> 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 上)运行此代码时,它运行良好。

知道问题可能是什么吗?

4

3 回答 3

2

安装 sublimeREPL 然后选择Tools->sublimerepl->python.

参考:<a href="http://gimo.me/sublime-text2-skills/" rel="nofollow">http://gimo.me/sublime-text2-skills/

于 2012-09-19T04:20:39.403 回答
1

取自 Sublime Text 的论坛,似乎 stdin 不会与任何东西连接,所以它是预期的。

来源:http ://www.sublimetext.com/forum/viewtopic.php?f=3&t=1519&p=6908&hilit=python+input#wrap

于 2012-02-12T13:09:47.833 回答
0

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.

于 2012-10-25T22:34:30.360 回答