Python Forum
need a little with python3.5 oprnibg other program - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: need a little with python3.5 oprnibg other program (/thread-3833.html)



need a little with python3.5 oprnibg other program - Blue Dog - Jun-28-2017

Hi,
  Sorry no code, been looking for some type of code to open and run other programs on win 7.
I made a very nice control program that does what ever I till it to do. One of the things I want
it to do is run exe programs. Is their a way to open and run, let say MS paint.
Thank you
renny

my code here



RE: need a little with python3.5 oprnibg other program - snippsat - Jun-28-2017

Quote:Is their a way to open and run, let say MS paint.
Use subprocess.
Open Ms paint.
C:\1
λ ptpython
>>> import subprocess

>>> subprocess.run(['mspaint.exe'])
Open a image in folder C:\1 with mspaint.
C:\1
λ ptpython
>>> import subprocess

>>> subprocess.run(['mspaint', 'C:/1/wx16.jpg'])
CompletedProcess(args=['mspaint', 'C:/1/wx16.jpg'], returncode=0)



RE: need a little with python3.5 oprnibg other program - Blue Dog - Jun-29-2017

Hey, snippsat that works very well Thank you very much .