python - How to auto-run a script -
I have created a script that tells me what to wear in the morning on the basis of weather (i.e. rain lashes if it will rain , Heavy jacket if it will be cold, etc.). I have a fairly basic programming experience with Python and the script works perfectly, but I want to be able to create a file, which I will be able to click just two times from my desktop and run the script automatically.
My goal is to be able to simply click [some] in the morning and it will run the script automatically and tell me what to wear
thanks
It worked for me on Snow Leopard:
- Press the Pyro script on the desktop.
- Right click on the script file, and select "Get Info"
- Find "Open With", and select "Python Launcher" from the dropdown box
Now clicking the script file will run the script in a new terminal Window
I'm not sure which version of OS X comes with the Python Launcher application. If you do not have it, you can solve it with a few additional steps:
- Press anywhere Python Script
- Open a desktop on the line with one line Create a script:
dragon / user / john / script / what -to- ""
(where did I take my script Is called - to-wear.py and / users / john / scripts. Keep in mind that you need to use a full path.)
- Shell script execution Qualified Create Terminal:
chmod 755 What-to-wear-shell-script
- It should be run in the terminal by double-clicking on the shell script, Run your dragon script
Comments
Post a Comment