Help : Beginner wxPython GUI application

hi everyone,
I am newbie in wxPython, Sorry in advance if my topic is posted
before , thou i have searched in many places and unable to find my
solution. I am trying to make a GUI in which there will be a main
layout GUI,in which one panel on the left and one panel on the right;
I want my buttons on the left and on click of each button executes
different application and get update on the right panel. each button
executes different file like in "subprocess()" but the output of the
file should update on the same right panel.Can any one help me.
Thanking you in advance for your precious help , and please dnt mind
of any mistakes in my post.

Anil ph

Hi,

hi everyone,
I am newbie in wxPython, Sorry in advance if my topic is posted
before , thou i have searched in many places and unable to find my
solution. I am trying to make a GUI in which there will be a main
layout GUI,in which one panel on the left and one panel on the right;
I want my buttons on the left and on click of each button executes
different application and get update on the right panel. each button
executes different file like in "subprocess()" but the output of the
file should update on the same right panel.Can any one help me.
Thanking you in advance for your precious help , and please dnt mind
of any mistakes in my post.

Anil ph

What you want to do is redirect stdout to a text control. You can have
a set of buttons on the left and a multiline text control on the
right. All these controls would be on one panel. I'd probably add the
buttons to a vertically oriented BoxSizer and then add the BoxSizer
instance and the textctrl to a horizontal BoxSizer.

Anyway, I've got a couple articles that should help you figure out
some of the plumbing. This one tells you how to redirect stdout:

And this one tells you one way to grab data from a process you run
with subprocess:

If you have questions, ask them here.

···

On Jul 7, 6:25 am, anil ph <ph.anilsha...@gmail.com> wrote:

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Thanks Mike,
Thanking you for the quick and immediate help.I would like to add more information on my problem which i may have missed out,sorry for this.I am using ubuntu linux , what i want to do is to update my right panel with a GUI which is define in another module in another python page . Like,I have 2/3 pages which displays different FFT displays of a signal which is implemented inside a frame.And i want to display this FFT display when i click on my button which triggers different FFTs, what i want is to update the part of the right side panel with the appropriate FFT display which is define in the another pages as a module… Hope I have narrated my requirement in a simple understandable way. Thanks in advance and please do guide me if i have made any mistakes in the post.

Thanks in advance again.

Anil ph

···

On Wed, Jul 7, 2010 at 9:25 PM, Mike Driscoll kyosohma@gmail.com wrote:

Hi,

On Jul 7, 6:25 am, anil ph ph.anilsha...@gmail.com wrote:

hi everyone,

I am newbie in wxPython, Sorry in advance if my topic is posted

before , thou i have searched in many places and unable to find my

solution. I am trying to make a GUI in which there will be a main

layout GUI,in which one panel on the left and one panel on the right;

I want my buttons on the left and on click of each button executes

different application and get update on the right panel. each button

executes different file like in “subprocess()” but the output of the

file should update on the same right panel.Can any one help me.

Thanking you in advance for your precious help , and please dnt mind

of any mistakes in my post.

Anil ph

What you want to do is redirect stdout to a text control. You can have

a set of buttons on the left and a multiline text control on the

right. All these controls would be on one panel. I’d probably add the

buttons to a vertically oriented BoxSizer and then add the BoxSizer

instance and the textctrl to a horizontal BoxSizer.

Anyway, I’ve got a couple articles that should help you figure out

some of the plumbing. This one tells you how to redirect stdout:

http://www.blog.pythonlibrary.org/2009/01/01/wxpython-redirecting-stdout-stderr/

And this one tells you one way to grab data from a process you run

with subprocess:

http://www.blog.pythonlibrary.org/2010/06/05/python-running-ping-traceroute-and-more/

If you have questions, ask them here.


Mike Driscoll

Blog: http://blog.pythonlibrary.org

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

OK, I think basically what you'll want to do is something like:

0) Import your FFT-display making modules into your app.

1) Come up with a layout of your buttons and right hand panel that you
like (best to use wxPython sizers there, but at first you don't have
to just to get started).

2) Figure out how you are embedding your FFT displays into a wxPython
app (or maybe you have already, and that's what you mean that it is
already in a frame?).

3) Bind EVT_BUTTON events to your buttons.

4) In their event handler functions, change the display appropriately
by doing something like destroying the current FFT display, invoking
the code in the other module that creates a new one, and .Show() that
new display in/as a panel on the right hand side. (or, if they are not
newly generated from new data each time, you could just .Hide() ones
you don't want to show and .Show() ones you do)

If you are new to wxPython, each of these may generate further
questions for you, but you can Google around for answers, search the
list archive, or ask more questions. Also, trying to make a small
runnable sample for the list, if you get stuck, is a great approach.
(MakingSampleApps - wxPyWiki)

Che

···

On Thu, Jul 8, 2010 at 12:29 AM, Anil Sharma <ph.anilsharma@gmail.com> wrote:

Thanks Mike,
Thanking you for the quick and immediate help.I would like to add more
information on my problem which i may have missed out,sorry for this.I am
using ubuntu linux , what i want to do is to update my right panel with a
GUI which is define in another module in another python page .
Like,I have
2/3 pages which displays different FFT displays of a signal which is
implemented inside a frame.And i want to display this FFT display when i
click on my button which triggers different FFTs, what i want is to update
the part of the right side panel with the appropriate FFT display which is
define in the another pages as a module.... Hope I have narrated my
requirement in a simple understandable way. Thanks in advance and please do
guide me if i have made any mistakes in the post.

Thanks Mike ,
I will try to implement what you have guided me and google out which ever i may need , and if more
problem comes up you wil have to guide me again.Hope you would not mind.
Thanks mike for your immediate reply and concern over my struggle to solve my problem.

Anil ph

···

On Thu, Jul 8, 2010 at 10:16 AM, C M cmpython@gmail.com wrote:

On Thu, Jul 8, 2010 at 12:29 AM, Anil Sharma ph.anilsharma@gmail.com wrote:

Thanks Mike,

Thanking you for the quick and immediate help.I would like to add more

information on my problem which i may have missed out,sorry for this.I am

using ubuntu linux , what i want to do is to update my right panel with a

GUI which is define in another module in another python page .

Like,I have

2/3 pages which displays different FFT displays of a signal which is

implemented inside a frame.And i want to display this FFT display when i

click on my button which triggers different FFTs, what i want is to update

the part of the right side panel with the appropriate FFT display which is

define in the another pages as a module… Hope I have narrated my

requirement in a simple understandable way. Thanks in advance and please do

guide me if i have made any mistakes in the post.

OK, I think basically what you’ll want to do is something like:

  1. Import your FFT-display making modules into your app.

  2. Come up with a layout of your buttons and right hand panel that you

like (best to use wxPython sizers there, but at first you don’t have

to just to get started).

  1. Figure out how you are embedding your FFT displays into a wxPython

app (or maybe you have already, and that’s what you mean that it is

already in a frame?).

  1. Bind EVT_BUTTON events to your buttons.

  2. In their event handler functions, change the display appropriately

by doing something like destroying the current FFT display, invoking

the code in the other module that creates a new one, and .Show() that

new display in/as a panel on the right hand side. (or, if they are not

newly generated from new data each time, you could just .Hide() ones

you don’t want to show and .Show() ones you do)

If you are new to wxPython, each of these may generate further

questions for you, but you can Google around for answers, search the

list archive, or ask more questions. Also, trying to make a small

runnable sample for the list, if you get stuck, is a great approach.

(http://wiki.wxpython.org/MakingSampleApps)

Che

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

Sorry…!!!, Thanx Che…B2B.gif

···

On Thu, Jul 8, 2010 at 10:16 AM, C M cmpython@gmail.com wrote:

On Thu, Jul 8, 2010 at 12:29 AM, Anil Sharma ph.anilsharma@gmail.com wrote:

Thanks Mike,

Thanking you for the quick and immediate help.I would like to add more

information on my problem which i may have missed out,sorry for this.I am

using ubuntu linux , what i want to do is to update my right panel with a

GUI which is define in another module in another python page .

Like,I have

2/3 pages which displays different FFT displays of a signal which is

implemented inside a frame.And i want to display this FFT display when i

click on my button which triggers different FFTs, what i want is to update

the part of the right side panel with the appropriate FFT display which is

define in the another pages as a module… Hope I have narrated my

requirement in a simple understandable way. Thanks in advance and please do

guide me if i have made any mistakes in the post.

OK, I think basically what you’ll want to do is something like:

  1. Import your FFT-display making modules into your app.

  2. Come up with a layout of your buttons and right hand panel that you

like (best to use wxPython sizers there, but at first you don’t have

to just to get started).

  1. Figure out how you are embedding your FFT displays into a wxPython

app (or maybe you have already, and that’s what you mean that it is

already in a frame?).

  1. Bind EVT_BUTTON events to your buttons.

  2. In their event handler functions, change the display appropriately

by doing something like destroying the current FFT display, invoking

the code in the other module that creates a new one, and .Show() that

new display in/as a panel on the right hand side. (or, if they are not

newly generated from new data each time, you could just .Hide() ones

you don’t want to show and .Show() ones you do)

If you are new to wxPython, each of these may generate further

questions for you, but you can Google around for answers, search the

list archive, or ask more questions. Also, trying to make a small

runnable sample for the list, if you get stuck, is a great approach.

(http://wiki.wxpython.org/MakingSampleApps)

Che

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en