$ python -i script.py
You can start interactive mode directly after executing script.py
by adding the -i
flag.
scripts.py
import numpy as np
def double_list(a):
b = np.array(a) * 2
return b.tolist()
x = 'Hello'
$ python -i script.py
>>> double_list([1,2,3])
[2, 4, 6]
>>> print(x)
Hello