0

I have a python script on my desktop that I want to execute by clicking on it. I have permissions set and all that, but it won't launch by clicking on it. I can start it using the terminal and everything works as expected.

Here's the script:

#!/usr/bin/env/python
import subprocess

subprocess.run(['python', '/filepath/EDITOR.py'])

subprocess.run(['python', '/filepath/ULTRASOUND_SIMULATOR.py'])

I've been able to launch the "ULTRASOUND_SIMULATOR.py" script from the desktop with a click.

6
  • 1
    #!/usr/bin/env/python is incorrect. It should be #!/usr/bin/env python. Commented Dec 21, 2022 at 21:47
  • I have tried that, and "python 3", and still nothing. I click, it offers 4 options: - execute, execute in terminal, open, cancel. Neither executes do anything. Commented Dec 22, 2022 at 14:05
  • Try #!/usr/bin/env python3 with no space. Commented Dec 22, 2022 at 14:53
  • I have tried many variations of the shebang. I have a different script that had #!/usr/bin/python3.7 and that one worked by clicking on it, and then execute. This time, I have two different scripts, both with the same shebang, and nothing happens. All the files are set to the right permissions. I am not sure what else I can try. Commented Dec 22, 2022 at 20:44
  • Are you sure the executable bit is set - chmod +x filename.py? My Pi seems to have disappeared, so I can't replicate your situation. There's really not much else I can think of... Commented Dec 23, 2022 at 2:23

0

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.