How can I run a Python file from another Python function effectively?

22 Replies, 1401 Views

Hey everyone!

So, I’ve been trying to figure out how to run a Python file from another Python function, and I’m kinda stuck. Like, I know I can use `subprocess` or `exec()`, but I’m not sure which one’s better or if there’s a cleaner way.

I tried googling, but most answers are either too complicated or don’t explain it in a way that makes sense to me lol.

Anyone got tips on how to run a Python file from another Python function effectively? Maybe something that doesn’t feel like a hack?

Also, if there are any gotchas or things to watch out for, pls lmk!

Thanks in advance! Smile

Messages In This Thread
How can I run a Python file from another Python function effectively? - by - 18-04-2024, 12:57 AM



Users browsing this thread: 1 Guest(s)