How to run a python file as admin?

4

I'm trying to run a python file, but it asks to be run as admin how do I do that?

    
asked by anonymous 20.02.2017 / 05:26

2 answers

4

Windows

Run the Command Prompt or PowerShell with the Run As Administrator option.

Run the command normally:

> python seu_script.py

Linux and Mac

In Terminal, use:

> sudo python seu_script.py
    
20.02.2017 / 05:30
0

That's right

python python_script.py

on windows

and

su
bash
chmod +x python_scrypt.py
sudo python python_script.py

in linux / osx

To install python modules (let's assume, google tensorflow, for example), you have to use as commands:

pip install myPythonExtenson 

this for python 2

for python 3 you should run

pip3 install myPythonExtension
    
20.02.2017 / 12:59