简体   繁体   English

在Mac中以管理员身份运行已编译的python(py2app)

[英]Running compiled python (py2app) as administrator in Mac

After looking at Running compiled python (py2exe) as administrator in Vista I was wondering if there's an easy way to get the Mac Authentication dialog in Python (specifically py2app) 在Vista中以管理员身份运行编译的python(py2exe)后,我想知道是否有一种简单的方法可以在Python中获取Mac身份验证对话框(特别是py2app)

I know mac has the built in Authentication services too http://developer.apple.com/library/mac/#documentation/Security/Reference/authorization_ref/Reference/reference.html 我知道mac也有内置的身份验证服务http://developer.apple.com/library/mac/#documentation/Security/Reference/authorization_ref/Reference/reference.html

Also, I know I could do something like this: 另外,我知道我可以这样做:

os.system("""osascript -e 'do shell script "<commands here>"  with administrator privileges'""")

but was wondering if there was a built in way to do this 但是想知道是否有内置的方法来做到这一点

据我所知,有一个Python Egg可以做到这一点,但是几年来作者一直没有支持它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM