the `-' in a prompt

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
btorb
Posts: 30
Joined: Fri Oct 21, 2005 8:14 am

the `-' in a prompt

Post 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
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: the `-' in a prompt

Post 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?
mattions
Posts: 65
Joined: Tue Jul 15, 2008 11:21 am
Location: EMBL-EBI Cambridge UK

Re: the `-' in a prompt

Post 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
apdavison
Posts: 14
Joined: Tue May 24, 2005 3:56 am
Location: CNRS, Gif sur Yvette, France
Contact:

Re: the `-' in a prompt

Post by apdavison »

Code: Select all

python -i file.py
Post Reply