Python Forum
how to open program file .exe from list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to open program file .exe from list
#1
here is my code
    if mybuffer == "b'Open'":
        print("Program is Opening")
        your_Po = (r'C:\Qt\5.13.1\mingw73_32\bin\designer.exe')
        fp = os.popen(your_Po) #use os.popen for get out from loop
but if i have 3 program with different path how I can open it with list of my 3 path of program?

like this your_Po = ('C:\Qt\5.13.1\mingw73_32\bin\designer.exe' , 'C:\Qt\5.13.1\mingw73_32\bin\designer1.exe',
'C:\Qt\5.13.1\mingw73_32\bin\designer2.exe')

Huh
Reply
#2
Make a list and loop.
Use subprocess and not os.popen().
Example.
import subprocess

run_lst = [
    r"C:\Qt\5.13.1\mingw73_32\bin\designer.exe",
    r"C:\Qt\5.13.1\mingw73_32\bin\designer1.exe",
    r"C:\Qt\5.13.1\mingw73_32\bin\designer2.exe",
]

processes = [subprocess.Popen([cmd]) for cmd in run_lst]
Reply
#3
Thank you
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  open a text file using list() Pedroski55 2 116 Feb-25-2026, 06:57 PM
Last Post: noisefloor
  If I open a file write or append, is the file loaded into RAM? Pedroski55 11 1,118 Jan-14-2026, 07:49 AM
Last Post: Pedroski55
Question [SOLVED] Open file, and insert space in string? Winfried 7 2,524 May-28-2025, 07:56 AM
Last Post: Winfried
  Trying to open depracated joblib file mckennamason 0 2,156 Sep-19-2024, 03:30 PM
Last Post: mckennamason
  Open/save file on Android frohr 0 2,187 Jan-24-2024, 06:28 PM
Last Post: frohr
  file open "file not found error" shanoger 8 17,397 Dec-14-2023, 08:03 AM
Last Post: shanoger
  Program to find Mode of a list PythonBoy 6 3,649 Sep-12-2023, 09:31 AM
Last Post: PythonBoy
  How can i combine these two functions so i only open the file once? cubangt 4 2,703 Aug-14-2023, 05:04 PM
Last Post: snippsat
  I cannot able open a file in python ? ted 5 15,868 Feb-11-2023, 02:38 AM
Last Post: ted
  testing an open file Skaperen 7 3,674 Dec-20-2022, 02:19 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020