1

I'm trying to call a python program from inside a program what do I use. I have a python file that checks a file name and if it's a certain file I want to run another program. Any suggestions on what to use.

1
  • Your question may have been answered here. Commented Apr 27, 2021 at 1:02

1 Answer 1

1

You can use the os.system command.

    import os
    os.system('python my_file.py')

i got this from https://www.tutorialspoint.com/How-can-I-make-one-Python-file-run-another

Sign up to request clarification or add additional context in comments.

3 Comments

Well my second program didn't run
well i got it from the website so idk whats happening i will test
import os os.system('python my_file.py') worked for me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.