Execute CMD commands using python
问题 what i'm trying to do is create a server and a client, the server being able to execute CMD commands. I managed to do the server-client communication but i have problems at controlling the command prompt using python. My current code is: import time import _thread import winpexpect class CommandPrompt(object): def __init__(self): self.cmd = winpexpect.winspawn('cmd.exe') def read(self): while True: if self.cmd.readline(): print(self.cmd.before) def send(self,usinput): self.cmd.sendline