Desperate. Say we have the following:
def main():
ALotOFCode
list1 = []
list2 = []
while condition:
# a lot of times where raw_input is used in this loop
# e.g.
x = raw_input('lots of steps to compute x')
y = raw_input('lots of steps to compute y')
list1 = list1.append(x)
list2 = list2.append(y)
stream.write({'x':list1,'y':list2}) #send new data point to plot.ly via raspberry pi
I don't know what happened. But my plot in plot.ly is gone. Deleted completely. I was messing with what I had on the plot thus far on my PC and then I continued inputting data and building the plot from raspberry pi. I could see the plot being built no problem. Then I went back to my PC and hit refresh. Plot and all data gone. Went back to raspberry. Already synced. Gone.
I know though that list1 and list2 right now as I am writing this contain all the data I need to remake my plot. But is there any way at all to access it and save it to file? My python shell is currently waiting for input via raw_input so I cant use the shell. Is there any way I can terminal my way into the variables currently in the scope of the still running program? Obviously once the program ends the local variables are deleted.
Of course if a history is saved for each plot on plot.ly that would help to but I cant find any restore to previous state option.
Update: So - thank god - I had saved the outputs of some of my intermediate steps to file. I effectively gave up trying to access the variable and instead tried generating list1
and list2
through a new on-the-fly script. At 8:30am in the morning I had my data and at 10am my supervisor happily looked at it none the wiser. This question remains open though as yet nobody has given a clear answer or explained how accessing list1
and list2
directly isn't possible. (I did go through each suggestion in the comments but couldn't find anything that provided an answer)
Obligatory final comment: My faith in Plot.ly has been shattered, at least for a while.