I want to run some python code i.e. example.py.
I don't want to enter code manually into Python shell since it slow:
x = 1
x
y = 2
y + x
y
And I'd like to achieve such output:
>>> x = 1
>>> x
1
>>> y = 2
>>> y + x
3
>>> y
2
It looks that is simple to answer, but very hard to find how to do it.
Since there was some questions this is not pattern to document "large code" that is for documenting/testing code snippets/examples!