Search code examples
pythonmacosauthorizationsudo

Mac OS X Python GUI Administrator Prompt


I have an OS X Python application that uses wxPython for it's GUI controls. I'm looking to prompt the user for administrative rights (akin to using the Authorization Service API in Objective-C) before starting a network service.

The closest library I have found is Bob Ippolito's Authorization library but it is fairly outdated and has compatibility issues with Snow Leopard (OS X 10.6.4 / Python 2.6.4).

My workaround would be to create an Objective-C launcher that runs the python application with administrative rights but that feels fairly kludgy.

Thanks for the help!


Solution

  • You could run your entire script with admin privileges by making it into a native Mac OS X application using Platypus.