I'm not sure what this is called but this is what I need. A portion of code in a python script that is stored in another file. When the script runs, automatically the code is inserted.... something like a function but without arguments passing.
line 100
line 101
line 102
line 103
line 104
I want lines 101-103 to be stored in another file. When the python script executes, lines 101-103 are automatically inserted as it is. So now my code looks like this
line 100
read code from another file
line 104
Even better, if I am able to select which codes to insert in between lines 100 and 104 (e.g. from file 1 or file 2 depending on condition)
I don't want to use a function because it involves a lot of variable passing.