在Pycharm中运行Koans的问题

时间:2013-10-30 22:56:36

标签: pycharm

我试图在PyCharm中运行Koans。我已经下载了所有必要的程序。我试图在pycharm中打开“contemplate_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)

1 个答案:

答案 0 :(得分:0)

如果我要直截了当地看待你,看起来你打开文件进行编辑而不是用Python执行它。您需要弄清楚如何执行它而不是从PyCharm中打开它,或者只是从命令行运行它。

使用Python从命令行运行它的说明可以在项目说明项目的“入门”部分的项目中找到:

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