w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Automatically running a python script after boot?

Bootup:

$ crontab -e

Add:

@boot cd /home/user/; python script.py

Login:

Edit one of these files:

  • nano /etc/profile.d/myscript.sh
  • ~/.bash_login

And add:

cd /home/user; python script.py

Graphical login:

nano ~/.xinitrc

Add:

eval(cd /home/user; python script.py) &

Ubuntu-Gnome specific login:

nano ~/.gnomerc




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.