P'sao
P'sao

Reputation: 2996

Iinput information into a command prompt in python?

I wanted to type this into a command prompt in windows: net users Administrator * And it returns type a password in the cmd I then want to type a password for eg:"pass" Then type it again after enter is pressed. How would i go about this? os.system() does not work. It goes to a new cmd each time. Any ideas?

Upvotes: 0

Views: 123

Answers (1)

zhongshu
zhongshu

Reputation: 7878

use subprocess, you can redirect input and output of the process you created.

Upvotes: 4

Related Questions