# python 3.8 # Ubuntu-mate 20.04 LTS
进入 /home/ubuntu/.config目录,创建autostart文件夹
cd ~/.config mkdir autostart
新建目标自启动文件
vim target.desktop
输入以下内容
[Desktop Entry] Name=pythonProgram Comment=pythonProgram Exec=python3 /home/ubuntu/Desktop/pythonPrograme.py # 终端执行程序的命令 X-GNOME-Autostart-enabled=true Terminal=false MultipleArgs=false Type=Application Categories=Application;Development; StartuoNotify=true