How to Run a Python File Using Another Python File Using Subprocess (Very Easy)

Опубликовано: 11 Август 2026
на канале: JameSparKing
54,069
752

It's very simple. In this video, I demonstrate how to run a python file using another python file. This is a nice trick to know and can be useful in some cases. Simply, import the call function from subprocess and use the call function.

I hope you guys find this video helpful. Feel free to like, subscribe, and share this video.

Code used in this video:

from subprocess import call

def open_py_file():
call(["python", "app.py"])

open_py_file()