The title maybe a little bit confusing, I will explain it.

I am using opensuse. Usually I work in a shell like this:
$vim test.py
$python test.py
>>>running...
>>>running...
>>>running...
>>>running...
$

Here the program end, but I cannot make further change nor access to the variable. I know I can do this:
$python
>>>
then paste the python code on it and it will run

But it is quite troublesome to open 2 shell and copy and paste...
Can anyone suggest a better method?

Thanks

You should run

$ python -i test.py

It runs your program, then starts the interactive python shell. You should also have a look at python -h.

Thanks!!
Really thanks!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.