Page 1 of 1

the `-' in a prompt

Posted: Mon Sep 22, 2008 5:19 am
by btorb
Dear, I'm encountering a small but annoying problem.It might be caused be caused by bad programming but still it deserves a solution. Normally when you add the "-" (dash) at the end of a nrniv command, neuron is not quitting after the last command. Now i want to obtain the same result when loading a simulation from python. As replied in another post of this forum, the "nrniv -python <pythonfile>" doesn't work at my system, so i cannot add the dash. when executing the file as "python <py_file_with_nrn_statements>" it works. However (due to the aforementioned bad programming), when i hit the stop button in the runcontrol, the whole simulation ends and neuron ends. Is there a way to load a python file, run it from python and not quit neuron after pressing the stop button?

Thanks, Ben

Re: the `-' in a prompt

Posted: Tue Oct 14, 2008 7:40 am
by hines
nrniv -python file.py
does not exit but stops with the >>> prompt.
I do not know how to do the same with
python file.py
The first line should work. Can you point me to the post that
mentions the problem with the first line?

Re: the `-' in a prompt

Posted: Thu Nov 20, 2008 4:34 am
by mattions
You can use ipython:

Launch it

Code: Select all

ipython

and at the prompt:

Code: Select all

In [1]: run file.py
it will execute the file and give you the prompt

Re: the `-' in a prompt

Posted: Thu Nov 27, 2008 6:28 pm
by apdavison

Code: Select all

python -i file.py