In python, you can run python3 -i some_file.py
to run some_file.py
, then open an interactive session in the file, allowing you to debug and such.
I have my own file full of functions and things to use for testing stuff out python3 -i ~/testing_functions.py
.
Is there a way I could use this in another file: python3 -i some_file.py -i ~/testing_functions.py
# a.py
a = "A"
# b.py
b = "B"
# in the shell
$ python3 -i a.py -i b.py
>>> print(a)
A
>>> print(b)
B
>>> pribt(a+b)
AB
When I try python -i file.py -i other.py
is does not work, and neither does python -i file.py other.py
I would like to avoid just importing if possible, as I don't know what directory I will be in or file I will test, and relative vs. absolute imports confuse me.