美文网首页
Two methods to run python script

Two methods to run python script

作者: cutelittlePanda | 来源:发表于2018-03-07 17:03 被阅读0次

Method 1: using 'Command line' pop-up window

cmd -> python name_python_script.py

Method 2:   config sublime text, and run the .py script within it's framework.

1). open 'sublime text' --> Tools --> Build System ... -->New Build System ...

2). copy text below, and then save it with the name of 'python3' :

{

"env": { "PATH":"F:/programFiles/python3.6.1/python.exe;%PATH%" },

"shell_cmd": "python -u \"$file\"",

"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",

"selector": "source.python",

//"encoding": "cp936"

"encoding": "utf-8"

}

3). restart sublime text, and then navigate to 'Tools --> Build System... --> select 'python3' '

4). open .py script in sublime text, then select 'Tools --> Build' to run it.

Done!!!

相关文章

网友评论

      本文标题:Two methods to run python script

      本文链接:https://www.haomeiwen.com/subject/hbajfftx.html