Atom Script won't execute anything but the first line (python)


I am very new to coding and have been practising with Python on my windows 10. I decided to get a nice editor instead of always working on a plain text notepad and executing python files in cmd.
I’ve also used Atom on my Mac and it works perfectly fine. However, with the exact same packages installed (all done on the same day as my Mac), when I practice python commands like:

  1. print “hello”
  2. print “hello again”

No matter what, only the very first line will show a result in the console after ctrl+shift+b. There are no errors when I highlight the second line and run the script, but there is no output.

How do I get the output to show up? even when I run the script for the whole file I only see output for whatever is on line one, everything else is blank. The run time still shows up, just no output…


I poked around the package issue tracker and the behavior you described sounds similar to this report? All the people that mention an OS were also on Windows:


If you want to run little bits of Python at a time, hydrogen might be the ideal solution for you.


I started using atom-runner and that has been working. I did find other threads where this problem exists for windows - no solutions were found yet.


Yea I came across those as well after I had posted this - no solutions found it seems :frowning:
Atom-runner has been working though!


Glad you found the issue too, it does look like it hasn’t been resolved yet. But I’m glad you found an alternative that works for you :raised_hands:


Could you attach a screenshot?


So, everything worked fine initially. I worked through multiple exercises, creating new files each time. Today, I decided to be bold and download an auto-complete package for Python to save time. Since then, my old files work fine, and I can delete all the code and rewrite what I want and it will print. (using the script package)

However, when I create a new file, only the first line will print. If there is more than one line, it will not print, but it will give me the green check that it is successful.


See, the old file (an exercise that I deleted and rewrote that code) will print
The new file, even copying and pasting the code from the other will not print



What happens if you save the new file? In your screenshots, the new and old file have different statuses (unsaved and saved), so it’s hard to be sure that the difference in behavior is because of the age of the files.


New here too, I had the same problem. Atom-runner works but for me, just saving it as something worked. Everything works smoothly after that.


you need to save the file in order for it to be read