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?

Asked By: peeterX



Possible you need to change the language selected in the bottom right corner, see here: still no go, might need to uninstall C++ packages in atom and reinstall atom-gpp-compiler, based on a github support thread I was reading through

Answered By: trebleCode

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.

Answered By: Natsfan

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.

Answered By: hmibrahimhasan
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.