Page 1 of 1

Neuron GUI with python?

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

Re: Neuron GUI with python?

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

Re: Neuron GUI with python?

Posted: Fri Aug 29, 2008 9:33 am
by mattions
this is doing the trick!! Thanks a lot!

Re: Neuron GUI with python?

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

Re: Neuron GUI with python?

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

Re: Neuron GUI with python?

Posted: Mon Mar 30, 2009 11:33 pm
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.

Re: Neuron GUI with python?

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

Re: Neuron GUI with python?

Posted: Tue Mar 31, 2009 11:13 am
by ramcdougal
Works great. Thanks.