Hello i have been playing around with python recently and have been trying to learn how to control external peripherals and i/o ports on my laptop.
I have been trying to disable USB ports and disable my network adapter. However when i run my program it does not work. The code does not have a specific syntax error but when it is ran nothing happens.
import subprocess
def main():
print("PROGRAM STARTED")
subprocess.call(["runas", "/user:Bradley", "cmd.exe /c netsh interface set interface '*' admin=disable"])
print("Program Exited")
if __name__ == "__main__":
main()
I think you should try to run such commands as admin in windows. This might help: https://social.technet.microsoft.com/Forums/windows/en-US/05cce5f6-3c3a-4bb8-8b72-8c1ce4b5eff1/how-to-run-a-program-as-adminitrator-via-the-command-line?forum=w7itproappcompat
You can also modify your command to print the output in stdout to debug easily.
print subprocess.check_output(['runas','/user:Bradley', "cmd.exe /c netsh interface set interface '*' admin=disable")
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
i am trying to create checkboxes for elements from a list, but since the list is subject to changes, i cannot proceed like this:
This is what I get when I press tab anywhere in the consoleSpaces are okay
i have a configuration file in python that can be changed while the main script is running, so i need to reload it
Iam new to djangoI need to upload a file using the Rest Framework API