Reputation: 56
In this example how to call "function func_call_from_terminal" from python terminal when the code running?
example: The name of the python script is "TEST.py"
def func_call_from_terminal():
# in this function I need to print I_Value ...
# where this function must call from terminal during...
# the running script TEST.py.
if __name__ == "__main__":
I_Value = 1
Flag = True
while Flag :
I_Value += 1
if I_Value == 1e9
Flag = False
Upvotes: 1
Views: 704
Reputation: 163
Just open terminal and use this command
python -c 'import TEST; TEST.func_call_from_terminal()'
Upvotes: 3