2013-10-30 46 views
0

我試圖在PyCharm中運行Koans。我已經下載了所有必要的程序。我試圖打開pycharm的「contemplate_koans」文件,但它與下面的消息進行響應:在Pycharm中運行Koans的問題

import unittest 
import sys 

if __name__ == '__main__': 
    if sys.version_info < (3, 0): 
     print("\nThis is the Python 3 version of Python Koans, but you are " + 
      "running it with Python 2!\n\n" 
      "Did you accidentally use the wrong python script? \nTry:\n\n" + 
      " python3 contemplate_koans.py\n") 
    else: 
     if sys.version_info < (3, 3): 
      print("\n" + 
       "********************************************************\n" + 
       "WARNING:\n" + 
       "This version of Python Koans was designed for " + 
       "Python 3.3 or greater.\n" + 
       "Your version of Python is older, so you may run into " + 
       "problems!\n\n" + 
       "But lets see how far we get...\n" + 
       "********************************************************\n") 

     from runner.mountain import Mountain 

     Mountain().walk_the_path(sys.argv) 

回答

0

如果我把你從字面上這一點,看起來像你打開該文件進行編輯,而不是執行它與Python。你或者需要弄清楚如何執行它,而不是從PyCharm中打開它,或者從命令行運行它。

說明從與Python在命令行中運行它可以在項目中找到該項目的說明中,「入門」部分:

https://github.com/gregmalcolm/python_koans/blob/master/README.rst