[Tutor] running more than one python program at the same time

akleider at sonic.net akleider at sonic.net
Wed Aug 29 05:28:37 CEST 2012


> On 08/28/2012 03:30 PM, Benjamin Fishbein wrote:
>> Hello,
>> I wrote a program that I want to have running 24/7. But the problem is
>> that I also want to write and run other programs. I'm using Idle and it
>> won't let me run more than one script at a time. Do you know if there's
>> a way to do this? Or do I need to buy a second computer?
>> Thanks,
>> Ben
> Can you make each script executable and run them without idle?
>
>
> Ray
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
The following works with Linux and might with OSX as well.
add "#!/usr/bin/env python"
as the first line of your script.
Then from the terminal change its permissions:
$ chmod 755 /paht/to/my/script/script.py
After that you can start your program with:
$ /path/to/my/script/script.py
If you add "&" to the end of the line it'll go into the background and
you'll get your terminal back.
I am less confident that the following will work on your Mac but there is
probably something equivalent.
If you wanted it to run when ever the computer is on, see if there is a
file called "/etc/rc.local"
If there is, edit it (you'll need root privileges to do so) and add as a
last line: "/path/to/my/script/script.py"
The words between the slashes will of course have to be modified to suit
your situation.







More information about the Tutor mailing list