how to make a python script run at startup

Michael Mauch michael.mauch at gmx.de
Wed Aug 3 17:46:43 UTC 2005


mustafa wrote:

> i use gnome.
> i want a python script to run at startup in the terminal.
> i entered the command in system--->prefferennces---->sessions
> but i could not choose start in terminal cuz the option was not there.

You could start your script in e.g. gnome-terminal.

  gnome-terminal -e your_script.py

> btw if this helps its a python script to automate management of mencoder
> Queues. it my very own and i really want to work.
> i have a power problem where i live so its essential that the script
> start automatically on restart.

Maybe it would be better to use a init script then?

> also this is off topic but is there any way i can set the priority(nice 
> value) of the scrpit(using a command or using some code in the python source

You can set the nice value with "nice":

  nice gnome-terminal -x your_script.py

or

  gnome-terminal -x 'nice your_script.py'

The terminal will close after your_script.py has finished.
If you want to see the output of your script even after it has finished,
append a read command (which waits for you to press Enter):

  gnome-terminal -x 'nice your_script.py; read'


Regards...
		Michael




More information about the ubuntu-users mailing list