def LoadPlist(filename):
"""Plists can be read with plistlib."""
# creating our own data
data = None
try:
p = subprocess.Popen(
['/usr/bin/plutil', '-convert', 'xml1', '-o', '-', filename],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out_data, err_data = p.communicate()
except IOError as e:
# file could not be found
print e
if(p.returncode == 0):
data = plistlib.readPlistFromString(out_data)
return data
read_launch_plists.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录