Answers for "python write cmd command"

1

python code to open windows command prompt

import os
def mycmd():
    os.system('cmd /c "ipconfig"')
mycmd()
Posted by: Guest on September-04-2020
1

python write to command prompt

import os
os.system("start /B start cmd.exe @cmd /k {command}")
Posted by: Guest on November-16-2020
4

how to execute a cmd command in python

CMD /K - execute a command then remain

import os
os.system('cmd /k "Your Command Prompt Command"')
Posted by: Guest on July-30-2020
1

how to run cmd command python

import subprocess
subprocess.run(["ls", "-l"])
Posted by: Guest on June-02-2020

Python Answers by Framework

Browse Popular Code Answers by Language