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

时间:2019-03-12 11:44:04

标签: python linux python-2.7 gtk gio

如何从.desktop文件提取Exec字段。吉奥可以帮我吗?

#!/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()

我完全是新手。

1 个答案:

答案 0 :(得分:1)

  

print launcher.get_commandline()