Jan-17-2019, 06:54 PM
(Jan-17-2019, 04:51 PM)nilamo Wrote: What output do you get if you pass a list tosubprocess.call()
?
>>> import subprocess >>> help(subprocess.call) Help on function call in module subprocess: call(*popenargs, timeout=None, **kwargs) Run command with arguments. Wait for command to complete or timeout, then return the returncode attribute. The arguments are the same as for the Popen constructor. Example: retcode = call(["ls", "-l"]) >>> subprocess.call(['netsh', 'interface', 'set', 'interface', 'Wi-Fi', 'disabled']) 0
Hello nilamo, Thanks for taking the time to work on my issues.
I tried your code and gives me the following error
import subprocess #help(subprocess.call) subprocess.call(['netsh', 'interface', 'set', 'interface', 'Wi-Fi', 'disabled'])
Output:The requested operation requires elevation (Run as administrator).
Process finished with exit code 0
FYI, I am using Pycharm as text editor. and i have tried to run my python script in the windows command terminal, but still no luck. Please advise.