Home > other >  Concerning with subprocess. Popen run CMD command.
Concerning with subprocess. Popen run CMD command.

Time:02-23

Need to connect the VPN in the program, part of the code below
{
 connect_cmd=f 'vpncli connect VPN}' 
P=Popen (connect_cmd, shell=True, the text=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)

Upon examination, has found please enter the password information. Next, the need to enter a password, online data show with
 out, err=p.com municate (input=0 \ 'n') 

Can and processes interact, but after I run, always stuck in there. Don't know is wrong usage or other problems, hope the guidance of experienced it. Or is there any other solutions.
  • Related