gpt4 book ai didi

python - 如何在 ubuntu 上使用 python 创建自动运行文件?

转载 作者:行者123 更新时间:2023-12-04 19:19:23 25 4
gpt4 key购买 nike

我需要在ubuntu上使用python登录系统时自动运行文件。谁能指导我如何在ubuntu上使用python创建自动运行文件。提前致谢。

最佳答案

首先回到家并按 ctrl+h 现在你可以看到隐藏文件夹,如果自动启动文件夹可用,则单击 .config 文件夹意味着只需创建具有桌面扩展名的文件,例如:auto.dsesktop。

在终端中输入以下命令

gedit .config/autostart/auto.desktop

并在 auto.destop 文件中输入以下命令
[Desktop Entry]
Type=Application
Exec=python filename.py #this is execution part so u can modify whatever u needs
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=<Name_to_be_displayed>
Comment=<optional comment>

关于python - 如何在 ubuntu 上使用 python 创建自动运行文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25762266/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com