Python EXE to request sudo access

只谈情不闲聊 提交于 2020-07-23 06:30:08

问题


I am working on a script to monitor my outgoing website connections. As an example, if I connect to reddit, I'd like the IP address of Reddit to be logged.

I have this functionality down just fine, but in the future, I'd like someone else to be able to run my Python code as an EXE file. However, my script currently requires you to run as Sudo since it is sniffing the IP addresses.

I'd like non-technical users to be able to use my app by simply clicking an EXE or entering their password if prompted. In order for it to provide maximum benefit for the end user, they would need the ability for it to run on computer start-up rather than having to activate it manually.

How can you run a Python EXE for this purpose without needing the user to utilize the command line? (I know how to make an EXE, but I mean not needing to use sudo)

OS would be mac and windows.

来源:https://stackoverflow.com/questions/62226169/python-exe-to-request-sudo-access

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!