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. :("