How to prepare and use scripts separately

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How to prepare and use scripts separately

TSUBOTA Masami
Dear all,

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

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

--
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wxPython-users?hl=en
Reply | Threaded
Open this post in threaded view
|

Re: How to prepare and use scripts separately

Robin Dunn
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. :-)
>
> 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 [hidden email]
or visit http://groups.google.com/group/wxPython-users?hl=en
Reply | Threaded
Open this post in threaded view
|

Re: How to prepare and use scripts separately

TSUBOTA Masami
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 <[hidden email]>:

> 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.
>> :-)
>>
>> 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 [hidden email]
> or visit http://groups.google.com/group/wxPython-users?hl=en

--
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wxPython-users?hl=en
Reply | Threaded
Open this post in threaded view
|

Re: How to prepare and use scripts separately

Werner-2
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?
There are THE books:

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

Other sources:
http://zetcode.com/wxpython/
http://www.blog.pythonlibrary.org/
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

--
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wxPython-users?hl=en
Reply | Threaded
Open this post in threaded view
|

Re: How to prepare and use scripts separately

Robin Dunn
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 [hidden email]
or visit http://groups.google.com/group/wxPython-users?hl=en
Reply | Threaded
Open this post in threaded view
|

Re: How to prepare and use scripts separately

TSUBOTA Masami
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. :-)

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 <[hidden email]>:

> 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 [hidden email]
> or visit http://groups.google.com/group/wxPython-users?hl=en

--
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wxPython-users?hl=en
Reply | Threaded
Open this post in threaded view
|

Re: How to prepare and use scripts separately

Patrick Maher
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

--
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wxPython-users?hl=en