Open Multiple applications using Python [duplicate](使用Python[duplicate]打开多个应用程序)

I want to start multiple applications using python script, basically there will be one text file which contains the paths of executable files and I want to open all of those applications one by one.
I tried it by using subprocess.Popen but it opens only first application from text file and even it executes only when text file has path of only one application, if I try to save multiple paths in text file then python script shows an error: [WinError 2] The system cannot find the file specified
I tried with readlines method too, but it didn’t worked

Below is the code I’m trying to execute

with open(path) as file:
   for x in file:
      subprocess.Popen(x)


Paths.txt file: 
C:\Windows\notepad.exe 
C:\Program Files\Sublime Text\sublime_text.exe

Solution:

The following works for me.

import subprocess
import time

with open('path.txt') as file:
   for x in file:
      subprocess.Popen(x.strip())

time.sleep(10)

# Content of path.txt:
#
# C:\Windows\notepad.exe 
# C:\Program Files (x86)\Notepad++\notepad++.exe
# C:\Program Files (x86)\Simple Sudoku\simplesudoku.exe
————————

我想使用python脚本启动多个应用程序,基本上会有一个包含可执行文件路径的文本文件,我想逐个打开所有这些应用程序。
我试着使用子流程。Popen,但它只打开文本文件中的第一个应用程序,甚至只在文本文件只有一个应用程序的路径时执行,如果我试图在文本文件中保存多个路径,则python脚本显示错误:[WinError 2]系统找不到指定的文件
我也尝试了readlines方法,但没有成功

下面是我试图执行的代码

with open(path) as file:
   for x in file:
      subprocess.Popen(x)


Paths.txt file: 
C:\Windows\notepad.exe 
C:\Program Files\Sublime Text\sublime_text.exe

解决方法:

以下内容对我很有用。

import subprocess
import time

with open('path.txt') as file:
   for x in file:
      subprocess.Popen(x.strip())

time.sleep(10)

# Content of path.txt:
#
# C:\Windows\notepad.exe 
# C:\Program Files (x86)\Notepad++\notepad++.exe
# C:\Program Files (x86)\Simple Sudoku\simplesudoku.exe