0

I want a script to run an then finish on the python shell with all variables and methods:

$ python myprogram.py

...
program output
...

>>> 

And with #!/usr/bin/python is posible? so I double-click and it just works?

Jaime Perez
  • 109
  • 2
  • 12

1 Answers1

5

Sounds like you want Python's i flag. From the help menu:

-i : inspect interactively after running script; forces a prompt even if stdin does not appear to be a terminal; also PYTHONINSPECT=x

So the full command would be

python -i yourscriptname.py
Kevin
  • 74,910
  • 12
  • 133
  • 166