2012-02-04 69 views
1

我想使用SublimeText2作爲IDE來開發Python中的應用程序。Python 3.1和Sublime Text 2錯誤

我有以下問題:

當我提出一個新的文件,將其保存爲蟒蛇做工具 - >構建系統 - > 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上)運行此代碼時,它完美地工作。

任何想法可能是什麼問題?

+0

是代碼中第二行的縮進嗎? – joaquin 2012-02-04 16:28:00

+1

我只能猜測,但是這個猜測是Sublime關閉或者不創建應用程序的標準輸入。最好在論壇上提問。 – 2012-02-04 16:32:52

+2

除了stdin的問題之外,它似乎並沒有真正在Python 3.1中運行它,因爲'raw_input'只是Python 3上的'input'。 – 2012-02-05 00:45:40

回答

0

我寫a plugin這使得建立在崇高的文本,以輸入。它的邊緣有點粗糙,但它適用於我的機器。