0

I was wondering if you can directly open them by clicking on something, etc. So you dont have to write the whole "cd (directory)" then "python (filename)". On Windows you can do this simply by double clicking the file, but I don't know for linux.

Thanks in advance.

HXLA
  • 21
  • 2
  • It would depend on your window and/or file manager, I would think. – Scott Hunter May 03 '20 at 22:24
  • BTW you don't have to type `python filename` to run a script - see https://stackoverflow.com/questions/15587877/run-a-python-script-in-terminal-without-the-python-command – Błotosmętek May 03 '20 at 22:28
  • On Linux you should be able to insert `#!/usr/bin/python` as the first line of your Python script, make it executable (`chmod a+x file.py`), then enter the path to run it. Probably you can do so directly from your file explorer (not sure), but you can certainly create a launcher for it. – Tom Karzes May 03 '20 at 22:32
  • Cross-site duplicate: https://superuser.com/questions/828737/run-python-scripts-without-explicitly-invoking-python – Tsyvarev May 03 '20 at 23:25

0 Answers0