How to setup Atom's script to run Python 3.x scripts? May the combination with Windows 7 Pro x64 be the issue?

This can be easily solved by editing the /home/.atom/packages/script/lib/grammars.coffee file (note that the atom folder is hidden so you might have to press ctrl+H to view hidden files and folders)

Inside grammars.coffee find:

  Python:
    "Selection Based":
      command: "python"
      args: (context)  -> ['-u', '-c', context.getCode()]
    "File Based":
      command: "python"
      args: (context) -> ['-u', context.filepath]

and replace with:

  Python:
    "Selection Based":
      command: "python3"
      args: (context)  -> ['-u', '-c', context.getCode()]
    "File Based":
      command: "python3"
      args: (context) -> ['-u', context.filepath]

Save changes, restart Atom and enjoy running your scripts with python 3

EDIT: On Windows I believe the grammars.coffee file is located in C:/Users/Your_Username/AppData/Local/atom/packages Again, the AppData folder is hidden so you might have to change your settings to view hidden files and folders.


To expand on @matt-nona answer. You can go to his mentioned config file right from Atom. Simply go to settings then "Open Config Folder":

enter image description here

Then /packages/script/lib/grammars.coffee Find "Python" and make the appropriate change to python3:

enter image description here