Apr-04-2021, 08:22 PM
How do I make python run another file from the local disk?
How to make python run other file?
|
Apr-04-2021, 08:22 PM
How do I make python run another file from the local disk?
Apr-04-2021, 08:47 PM
You could be more specific about file types and task it should to do.
If it's a .py then module or packages is used for that trough import .subprocess is way for Python to run other files. So example this will on Windows run ping.exe and we capture output it gives.import subprocess out = subprocess.run(['ping', 'google.com'], capture_output=True, encoding='utf-8') print(out.stdout)
Apr-05-2021, 09:17 PM
I am wanting to run another
.py
Apr-05-2021, 09:18 PM
And I use OSX.
Apr-06-2021, 06:39 PM
If you have code in another Python module or package, then as above, import the functions, classes, etc. and use them.
Also show a code sample if you're still confused. |
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
How to make it so whatever I input into a script gets outputted on a different file | spermatozwario | 4 | 1,131 |
Nov-24-2024, 12:58 PM Last Post: deanhystad |
|
How to make a test data file for the full length of definition? | MDRI | 6 | 4,818 |
Apr-16-2021, 01:47 AM Last Post: MDRI |
|
Is there anyway to make a .py file into a .exe file? | Oshadha | 2 | 3,088 |
Jan-13-2021, 04:58 AM Last Post: Oshadha |
|
make a list of the file in the folder and change the name of file regarding to time | go127a | 5 | 4,054 |
Feb-21-2020, 10:36 AM Last Post: go127a |
|
Python: possibilty ro make a list of the file in the folder & change the name of file | go127a | 0 | 2,108 |
Feb-05-2020, 01:16 PM Last Post: go127a |
|
Trying to make column based file from text file | scor1pion | 7 | 4,772 |
Jul-16-2019, 02:43 PM Last Post: scor1pion |
|
How to make a list file in Python. | punyashloke | 2 | 3,347 |
Aug-19-2018, 07:04 AM Last Post: BIGPESH |