简体   繁体   English

Python 3.1和Sublime Text 2错误

[英]Python 3.1 and Sublime Text 2 error

I want to use a SublimeText2 as IDE for developing applications in Python. 我想使用SublimeText2作为IDE在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 当我制作一个新文件时,将其另存为python并执行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. 但是,当我从终端(我在Mac上)运行此代码时,它可以完美运行。

Any idea what the problem might be ? 知道可能是什么问题吗?

Install sublimeREPL and then choose Tools->sublimerepl->python . 安装sublimeREPL,然后选择Tools->sublimerepl->python

Reference: http://gimo.me/sublime-text2-skills/ 参考: http : //gimo.me/sublime-text2-skills/

Taken from Sublime Text's forums, seems that stdin will not be connected with anything so it's expected. 来自Sublime Text的论坛,看来stdin不会与任何东西连接,因此可以预期。

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

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. 边缘有些粗糙,但可以在我的机器上使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM