a caveat
Posted: Sat Sep 15, 2007 9:59 pm
From a python shell, if I do
While I would rather destroy h instead of quit my python shell. Is it possible at all?
I was actually trying to clear everything I did with this session and would like to start a new simulation, however, it seems hard to manage without restarting a python shell:
So the h still points to the same HocObject that has everything I've done which has not been cleaned.
Code: Select all
>> import neuron
>> h = neuron.HocObject()
>> h("a = 10")
>> h("print a")
10
>> h.quit() # this quits the python shell.
I was actually trying to clear everything I did with this session and would like to start a new simulation, however, it seems hard to manage without restarting a python shell:
Code: Select all
...
>> print h.a
10
>> "Let's try to clean up things"
>> del h
>> from sys import modules
>> del neuron
>> del modules['neuron.hoc']
>> del modules['neuron']
>> "try it again, will there be a fresh session?"
>> import neuron
>> h = neuron.HocObject()
>> print h.a
10
>> "nothing got cleaned. :("