How to prepare and use scripts separately

Dear all,

I'm quite a new comer for wxPython and this is my first post in this ML. :slight_smile:

I want to make scripts for the main GUI frame and an about dialog separately
like the following:
* main.py
* about.py

I confirmed that each script run in a normal way.

What I want to know is that how to call about.py from main.py.
Do you have any suggestions or direct a useful web site?

Thank you in advance.

Wishes,
Masa

The same way you would with any other Python code, such as things in the standard library or from wxPython. You import the things from the module where they live into the module where you need to use them, and then you use them normally. For example:

import about
...

dlg = about.AboutDialog(...)

···

On 4/4/12 11:58 AM, TSUBOTA Masami wrote:

Dear all,

I'm quite a new comer for wxPython and this is my first post in this ML. :slight_smile:

I want to make scripts for the main GUI frame and an about dialog separately
like the following:
* main.py
* about.py

I confirmed that each script run in a normal way.

What I want to know is that how to call about.py from main.py.
Do you have any suggestions or direct a useful web site?

--
Robin Dunn
Software Craftsman

Dear Robin,

Thank you for your reply.

It worked!

And after that, I found so many sample codes in my PC,
i.e., wxPython2.8 Dos and Demos folder. I would somehow
make my own GUI programs by arranging/assembling
the sample dodes.

How do you think which is the best text book or web site
explaining wxPython systematically?

Anyway, thank you again.

Wishes,
Masa

···

2012/4/5 Robin Dunn <robin@alldunn.com>:

On 4/4/12 11:58 AM, TSUBOTA Masami wrote:

Dear all,

I'm quite a new comer for wxPython and this is my first post in this ML.
:slight_smile:

I want to make scripts for the main GUI frame and an about dialog
separately
like the following:
* main.py
* about.py

I confirmed that each script run in a normal way.

What I want to know is that how to call about.py from main.py.
Do you have any suggestions or direct a useful web site?

The same way you would with any other Python code, such as things in the
standard library or from wxPython. You import the things from the module
where they live into the module where you need to use them, and then you use
them normally. For example:

import about
...

dlg = about.AboutDialog(...)

--
Robin Dunn
Software Craftsman
http://wxPython.org

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

There are THE books:

wxPython in Action - by Robin Dunn and Noel Rappin
wxPython 2.8 - by Cody Precord

Other sources:

http://wiki.wxpython.org/

on the wiki to start with:
http://wiki.wxpython.org/How%20to%20Learn%20wxPython
http://wiki.wxpython.org/Using%20wxPython%20Demo%20Code

Werner

···

On 05/04/2012 09:38, TSUBOTA Masami wrote:

Dear Robin,

Thank you for your reply.

It worked!

And after that, I found so many sample codes in my PC,
i.e., wxPython2.8 Dos and Demos folder. I would somehow
make my own GUI programs by arranging/assembling
the sample dodes.

How do you think which is the best text book or web site
explaining wxPython systematically?

Just for the record, the full title of Cody's book is "wxPython 2.8 Application Development Cookbook"

There are publisher and Amazon affiliate links at the bottom of the main http://wxPython.org/ page.

···

On 4/5/12 3:33 AM, Werner wrote:

On 05/04/2012 09:38, TSUBOTA Masami wrote:

How do you think which is the best text book or web site
explaining wxPython systematically?

There are THE books:

wxPython in Action - by Robin Dunn and Noel Rappin
wxPython 2.8 - by Cody Precord

--
Robin Dunn
Software Craftsman

Dear Werner and Robin,

Thank you so much for your fruitful replies.

I didn't noticed that Robin is THE author of THE book.
I ordered Robin's book. :slight_smile:

I will also visit the web sites which Werner told me.

The problem for us, the Japanese, is that resources
about python written in Japanese is not too much.

Cheers,
Masa

···

2012/4/6 Robin Dunn <robin@alldunn.com>:

On 4/5/12 3:33 AM, Werner wrote:

On 05/04/2012 09:38, TSUBOTA Masami wrote:

How do you think which is the best text book or web site
explaining wxPython systematically?

There are THE books:

wxPython in Action - by Robin Dunn and Noel Rappin
wxPython 2.8 - by Cody Precord

Just for the record, the full title of Cody's book is "wxPython 2.8
Application Development Cookbook"

There are publisher and Amazon affiliate links at the bottom of the main
http://wxPython.org/ page.

--
Robin Dunn
Software Craftsman
http://wxPython.org

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

As a place to get started, I recommend the online tutorial http://www.zetcode.com/wxpython/. I found Robin’s book very useful after I had worked through that.

Patrick