Neuron GUI with python?

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

Moderator: hines

Post Reply
mattions
Posts: 65
Joined: Tue Jul 15, 2008 11:21 am
Location: EMBL-EBI Cambridge UK

Neuron GUI with python?

Post by mattions »

Hi all,
I'm trying to use python and the neuron GUI, but every time that I lunch the GUI it freeze and it is completely unresponsive...
I think it's a problem of thread sync...
Is there any known solution, or I should keep going with hoc?
apdavison
Posts: 14
Joined: Tue May 24, 2005 3:56 am
Location: CNRS, Gif sur Yvette, France
Contact:

Re: Neuron GUI with python?

Post by apdavison »

I find that the GUI works if launching the Python interpreter via

nrngui -python

but not with plain "python"

(this is on Linux and Darwin, don't know about Windows)
mattions
Posts: 65
Joined: Tue Jul 15, 2008 11:21 am
Location: EMBL-EBI Cambridge UK

Re: Neuron GUI with python?

Post by mattions »

this is doing the trick!! Thanks a lot!
btorb
Posts: 30
Joined: Fri Oct 21, 2005 8:14 am

Re: Neuron GUI with python?

Post by btorb »

On my system (ubuntu 4.1.2)the proposed solution doesn't work. the code only seems to work when directly loaded from python (python <py_file_with_nrn_statement>)

Ben
mattions
Posts: 65
Joined: Tue Jul 15, 2008 11:21 am
Location: EMBL-EBI Cambridge UK

Re: Neuron GUI with python?

Post by mattions »

Hi btorb,

I don't know but it seems you have a really old systems (4.1.2) has been discontinued long time ago. I think you should try to upgrade and check again.
I'm running an ubuntu 8.04 with neuron 6.2.3 and the way proposed above it's working fine.
ramcdougal
Posts: 267
Joined: Fri Nov 28, 2008 3:38 pm
Location: Yale School of Public Health

Re: Neuron GUI with python?

Post by ramcdougal »

Sorry to resurrect an old conversation, but...

Did anyone ever figure out a good way to get the gui from python? If I start with "nrngui -python" and get a python interpretor that way, everything works wonderfully, but what I want to do is:

$ python
Python 2.5.2 (r252:60911, Oct 5 2008, 19:29:17)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import neuron
NEURON -- Release 7.0 (281:80827e3cd201) 2009-01-16
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
See http://www.neuron.yale.edu/credits.html

>>> from neuron import h
>>> h('load_file("nrngui.hoc")')
1
1
>>> quit()

That almost works. Only one problem: As the original poster mentioned, this leads to a nonresponsive menu. If I enable composting (in Ubuntu 8.10), it's even worse: the window with the menu shows up in the window list, shows up in the workspace switcher, can even be moved... but is completely invisible.
emuller
Posts: 15
Joined: Thu Mar 02, 2006 5:26 am
Location: Lausanne

Re: Neuron GUI with python?

Post by emuller »

Generally, at least since NEURON 7.0, one can do the following:

$ python
>>> from neuron import gui

And the GUI will appear.

See:
https://www.neuron.yale.edu/phpBB2/view ... 1405#p5213
ramcdougal
Posts: 267
Joined: Fri Nov 28, 2008 3:38 pm
Location: Yale School of Public Health

Re: Neuron GUI with python?

Post by ramcdougal »

Works great. Thanks.
Post Reply