Click here to Skip to main content
15,923,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a python script example: python example.py (do some stuff)

Instead of placing this in cmd, is there a way I can run the above from a text file? example content of text file:

python example.py (do some stuff 1)
python example.py (do some stuff 2)
python example.py (do some stuff 3)
python example.py (do some stuff 4)

How can I implement the above in python? Is it even possible? Thanks in advance :)

What I have tried:

I have been looking around for an applicable example but have not yet found one
Posted
Updated 28-Aug-21 20:28pm

I strongly recommend you don't do that. It's a really big security hole that is incredibly easy to exploit ...

But, it's simple enough to do: 2. Built-in Functions — Python 2.7.18 documentation[^]

Think long and hard before you do it.
 
Share this answer
 
Thanks, I did a work around I just realized that you can give python multiple arguments at once and it will work through each, appreciate the heads up
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900