Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在python中打开新的powershell窗口_Python_Windows_Powershell - Fatal编程技术网

在python中打开新的powershell窗口

在python中打开新的powershell窗口,python,windows,powershell,Python,Windows,Powershell,我正在从powershell运行python脚本 我想从这个python脚本打开另一个powershell窗口,以便该脚本可以与这个新的powershell窗口交互 subprocess.call('C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe', shell=True) 没有打开新窗口 提前谢谢 在c:\之前添加start,如下所示:subprocess.call('start c:\\Windows\\Syst

我正在从powershell运行python脚本

我想从这个python脚本打开另一个powershell窗口,以便该脚本可以与这个新的powershell窗口交互

subprocess.call('C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe', shell=True)
没有打开新窗口


提前谢谢

在c:\之前添加start,如下所示:subprocess.call('start c:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe',shell=True)创建ps1文件,并在运行powershell时将其作为参数添加
subprocess.call('start C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe-将您的\u ps1\u文件\u路径归档,shell=True)
我认为您无法从powershell获取输入并使用python以本机方式处理它。谢谢,这将按需要打开一个新窗口。但是如何从python脚本与该窗口交互?我现在使用subprocess.Popen和p.stdin.write,但这不起作用