These are chat archives for ipython/ipython

6th
Oct 2016
tomVeloso
@tomVeloso
Oct 06 2016 12:21
externally from a ipython iteractive shell session is possible retrive data ?
for example if in the session i loaded a dataframe and made some processing on it with a line like df = pd.read_data(path).apply(somefuncion)
can I retrive data store in the df varible from outside?
Min RK
@minrk
Oct 06 2016 12:25
Depends what you mean by 'outside'
tomVeloso
@tomVeloso
Oct 06 2016 12:26
I lunched a ipython shell from a certain bash session and now I lose acces to that bash session
Min RK
@minrk
Oct 06 2016 12:27
You want to exit IPython but without losing things?
tomVeloso
@tomVeloso
Oct 06 2016 12:27
some how I want come back to the ipython session
to get the data
the line I alredy processed
unfortunatly I did not use screen or tmux
Min RK
@minrk
Oct 06 2016 12:29
You can save serializable objects with %store df
Then reload with %store -r
in a future session
tomVeloso
@tomVeloso
Oct 06 2016 12:29
but I can do that once back on the orginal session
right?
Min RK
@minrk
Oct 06 2016 12:30
Right, %store df stores the current variable on disk. In a later session, %store -r reloads df from disk.
tomVeloso
@tomVeloso
Oct 06 2016 12:30
in this moment I see the process ipyton runnig on my machine
Min RK
@minrk
Oct 06 2016 12:31
Or you can do things like df.to_pickle('df.pickle')
tomVeloso
@tomVeloso
Oct 06 2016 12:31
the problem is that I do not know
how I can come back to the orginal sessio
I loose the bash that lunched it
Min RK
@minrk
Oct 06 2016 12:32
oh
tomVeloso
@tomVeloso
Oct 06 2016 12:32
I have the pid of that bash
Min RK
@minrk
Oct 06 2016 12:32
that may not be possible
tomVeloso
@tomVeloso
Oct 06 2016 12:33
I hoped that there was a sort of kernel I could query in order to retrive variable aviable at that moment for that kernel
Min RK
@minrk
Oct 06 2016 12:34
There is when you are using IPython remotely (e.g. in a notebook), but terminal IPython sessions don't do this.
tomVeloso
@tomVeloso
Oct 06 2016 12:35
so In general once you are running an interactive programm in a bash shell and you loose acces to the bash shell running this progrma is not possible to come back to that interactive progmm
Min RK
@minrk
Oct 06 2016 12:36
There's not a wayt that I know of. It might be possible, though.
tomVeloso
@tomVeloso
Oct 06 2016 12:38
thanks for the help @minrk
jldiaz
@jldiaz
Oct 06 2016 13:39
@tomVeloso To prevent future cases like that, you can use a tty multiplexer, like screen or tmux
If the connection to the remote shell is lost, the bash (and other processes) running inside the multiplexer are not stopped. You can login again, reattach to the multiplexer and continue using them