Currently I have....
file_1.py
x = "Carrots"
print (x)
file_2.py
x = "Spinach"
print (x)
file_3.py
x = "Peas"
print (x)
Now let's say I wanted to change print (x)
to another command. In that case I would need to change file_1.py
, and file_2.py
, and file_3.py
. I would prefer to make changes to one file, which I am calling main_file.py
to accomplish the same result.
Therefore, I want to create something like...
python3 file_1.py | main_file.py
where...
file_1.py
x = "Carrots"
and...
main_file.py
print (x)
or something like...
file_1.py
x = "Carrots"
send x to main_file.py
file_2.py
x = "Spinach"
send x to main_file.py
file_3.py
x = "Peas"
send x to main_file.py
where main_file.py
contains a command such as print (x)
.
I have reviewed...