0

script i am using this package on atom.

getting this error

[Command: python3 -u '/home/aditya/Documents/python/py4e book solved problems/not done py4e 5.10ex q1 loop.py']

after making change to. [/home/aditya/.atom/packages/script/lib/grammars] i had changed python to python3

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

  'File Based':
    command: 'python3'
    args: ({filepath}) -> ['-u', filepath]
4
  • welcome to SO! please read minimal reproducible example and edit your post accordingly addition to that add some context to your question like what have you tried? what error you getting? what you trying to achieve? what is expected etc.. Commented Jul 31, 2019 at 19:36
  • @Aditya singh I don't know if I understood your question correctly. But I presume you aren't able to run your python scripts through atom on ubuntu? Commented Aug 1, 2019 at 7:43
  • Yes, iam not able to run python3 in atom Commented Aug 1, 2019 at 9:22
  • Did you read this? stackoverflow.com/questions/35546627/… Commented Aug 1, 2019 at 12:31

2 Answers 2

1

EDIT: if you just want to run python3 through atom: Open the atom-python-run package settings (atom Settings >> packages >> find atom-python-run >> settings)

In F5 command section, change the default to python3 {file}. It should look something like this.

EDIT: Make sure that F5 doesn't interfere with another command from another package. Or else you can use F6 as well. enter image description here

Restart, atom. You should be good to go!

If you aren't able to run python scripts through atom. Then here's the package you can install.

atom-python-run

In short:

  1. You need python installed on your computer and you need to add it to your PATH

  2. Restart atom

  3. To run your (.py) file, hit F5 or F6

Hope this helps!

Sign up to request clarification or add additional context in comments.

8 Comments

I want too run python3
That package does exactly that. You just need to have python 3 installed to your machine
Yes i have.iam using ubuntu 18.04
No it auto run with python2
That wouldn't happen. The package just allows you to run the script through atom. Check the version with python -v. I believe you just have a different version. The package does no auto run.
|
0

Try running "sudo ln -s /usr/bin/python3 /usr/bin/python".

Anyway you can change the default to python3 {file} on settings atom python run from.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.