So, I have the following files: main.py, a1.py, a2.py and b1.py, b2.py.
Depending on whether I want to run the "type a" version of the code (of main.py) or the "type b" version, I import a1.py, a2.py or I import b1.py, b2.py.
For instance, see these lines of code below. Depending on whether the user inputs "type a" or "type b" for variable "code_type," the main.py code will import the a files or the b files.
QUESTION: Is there another way to run a certain version of the main.py code from the command prompt (rather than having to create 2 different main.py files, one for type a and one for type b). Maybe something like %python main.py type_a or %python main.py type_b to import the type a or type b files?
It's just I rather not have to go into the main.py file to edit the "code_type" variable every time.
Thanks!
if code_type=='type a':
from a1 import *
from a2 import *
elif code_type=='type b':
from b1 import *
from b2 import *
else:
print("Please enter 'type a' or 'type b' for variable 'code_type'")
sys.exit()