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 » Thu Aug 28, 2008 2:04 pm

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 » Fri Aug 29, 2008 6:48 am

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 » Fri Aug 29, 2008 9:33 am

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 » Mon Sep 22, 2008 5:07 am

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 » Wed Oct 01, 2008 6:35 am

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: 155
Joined: Fri Nov 28, 2008 3:38 pm
Location: Yale School of Medicine

Re: Neuron GUI with python?

Post by ramcdougal » Mon Mar 30, 2009 11:33 pm

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 » Tue Mar 31, 2009 6:13 am

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: 155
Joined: Fri Nov 28, 2008 3:38 pm
Location: Yale School of Medicine

Re: Neuron GUI with python?

Post by ramcdougal » Tue Mar 31, 2009 11:13 am

Works great. Thanks.

Post Reply