I have the following code:
command = "slmgr /upk"
pipe = subprocess.Popen(command, shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
out, err = pipe.communicate()
result = out.decode()
return result
It works perfectly, but since the slmgr /upk command does not output in actual Command Prompt meaning the value result is nothing. The command slmgr /upk opens a new program Windows Script Host. I want Python to alt tab into this and then press Enter or OK.