NOTE: This is for MacOSX
I am working on a launcher for an app and the only way I can make terminal find the file is putting the direct root. If I can get around this so it would work in any location what would the code be? Here is the code in the executable:
#!/bin/bash
python /Users/imac/Desktop/Notepad+/Contents/main.py
The path always will change from computer to computer. You can run executable in the same directory with
python main.py
for python 3
python3 main.py
Your shell script will be like.
#!/bin/bash
python main.py
I hope it will help
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.