简体   繁体   中英

How to run python script using atom?

I have been using atom code editor to write C code and run it using a gcc compiler, recently I started out on python code and have been trying to run python script using atom code editor but i keep on getting errors, is there a way to fix this?

Having run C on atom should not interfere with you running python. Make sure you've installed the python extension and you name your file with the py extension. Also, install the 'script' extension. Enter your script and hit command-I. The script extension should then run your script. Command-I is just a shortcut to run script. You can install these extensions (add-ons) by going to Preferences under the Atom menu item. This opens a window in Atom and you can install from a list of available extensions.

可能需要更改在右下角选择的语言,请参见此处: https : //user-images.githubusercontent.com/31619951/31304897-b0900c7e-ab4a-11e7-803c-b34168895ed3.PNG如果仍然无法通过,则可能需要根据我正在阅读的github支持线程,卸载atom中的C ++软件包并重新安装atom-gpp-compiler

If you run atom-python-run and gpp-compiler at the same time it will show you this error.

So disabling gpp-compiler will not show this problem when you want to run Python. And when you run C then disabling atom-python-run and enable gpp-compiler will solve your problem.

I am a junior and this is the way I have solved my problem, please correct me if there is any mistake. And if anyone has an easier way, please share.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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