gpt4 book ai didi

python - 如何从桌面文件中获取 Exec 字段

转载 作者:太空宇宙 更新时间:2023-11-04 10:02:26 24 4
gpt4 key购买 nike

如何从 .desktop 文件中提取 Exec 字段。 Gio 可以帮助我吗?

#!/usr/bin/python2

import os
from gi.repository import Gio

launcher = Gio.DesktopAppInfo.new_from_filename('/usr/share/applications/chromium.desktop')
# how get Exec field from desktop file
# cat /usr/share/applications/chromium.desktop | grep ^Exec

#retval = launcher.launch_uris()

我完全是新手..

最佳答案

print launcher.get_commandline()

关于python - 如何从桌面文件中获取 Exec 字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55120683/

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