468,294 Members | 1,932 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,294 developers. It's quick & easy.

some questions about Python and tkinter

Hi every one,
I m a sysadmin who want to know how to use python.
I dont know anything about oriented object programation, i only know
bash and a little perl.
I have some simple questions about python.

the first: what is the differences between a function and a classe?

In which case i should use a function ?
In which case i should use a class ?

The second: there is some pincipals gui toolkit: tkinter , Python Mega-
Widgets, PyGTK, PyQt, FxPy, WxPy

what are the advantages of each one, and in which case i use each of
them?

thanks by advance,

Fabrice.witkowski

Oct 16 '07 #1
4 1690
fabdeb a écrit :
Hi every one,
I m a sysadmin who want to know how to use python.
I dont know anything about oriented object programation, i only know
bash and a little perl.
I have some simple questions about python.

the first: what is the differences between a function and a classe?
I suppose you do know what a function is. Else it would be time to go
for some CS introductory material...

A class is the definition of a family of objects. If that doesn't mean
anything to you, then just forget about classes and OOP for now.
In which case i should use a function ?
When you have a (mostly self-contained) piece of code you want to call
by name from different places.
In which case i should use a class ?
If you don't know, then don't use them for the moment. First learn to
use Python without them.
The second: there is some pincipals gui toolkit: tkinter , Python Mega-
Widgets, PyGTK, PyQt, FxPy, WxPy

what are the advantages of each one, and in which case i use each of
them?
This is a FAQ IIRC.
Oct 16 '07 #2
On Oct 16, 1:52 pm, fabdeb <fabrice.witkow...@gmail.comwrote:
Hi every one,
I m a sysadmin who want to know how to use python.
I dont know anything about oriented object programation, i only know
bash and a little perl.
I have some simple questions about python.

the first: what is the differences between a function and a classe?

In which case i should use a function ?
In which case i should use a class ?

The second: there is some pincipals gui toolkit: tkinter , Python Mega-
Widgets, PyGTK, PyQt, FxPy, WxPy

what are the advantages of each one, and in which case i use each of
them?

thanks by advance,

Fabrice.witkowski
For functions see:

http://docs.python.org/ref/function.html
http://www.penzilla.net/tutorials/python/functions/

For classes see:

http://docs.python.org/tut/node11.html
http://www.diveintopython.org/object...g_classes.html

As for GUI toolkits, that is a contentious subject. The two major ones
usually mentioned here are Tkinter and wxPython. Others argue for
PyGTK and pyQT. I recommend to see the following links:

http://wiki.wxpython.org/Choosing_wxPython_over_Tkinter
http://wiki.python.org/moin/GuiProgramming

Tkinter and wxPython are the ones I've used and recommend, although
currently I use wxPython the most. Both are very much cross-platform,
although wxPython may have the edge when it comes to native look on
most platforms and it has more built-in widgets than Tkinter. You
should check them both out and see what you think.

As far as I know, they can be used for pretty much any GUI interface,
so I don't think you have to worry about use cases.

Mike

Oct 16 '07 #3
On Tue, 16 Oct 2007 11:52:22 -0700, fabdeb wrote:
the first: what is the differences between a function and a classe?
A class bundles data and functions into one object.
In which case i should use a function ?
In which case i should use a class ?
If you have several functions that operate on the same data it might make
sense to put all into a class to treat them as one "unit".
The second: there is some pincipals gui toolkit: tkinter , Python Mega-
Widgets, PyGTK, PyQt, FxPy, WxPy

what are the advantages of each one, and in which case i use each of
them?
`Tkinter` is part of the standard library. If you use that or one of the
others is a matter of taste to some degree. In a GNOME environment PyGTK
may look more natural, under KDE a PyQt or PyKDE based GUI may feel more
"native". Another factor for a decision might be the license of the GUI
toolkit.

Ciao,
Marc 'BlackJack' Rintsch
Oct 16 '07 #4
On Oct 16, 9:17 pm, Marc 'BlackJack' Rintsch <bj_...@gmx.netwrote:
On Tue, 16 Oct 2007 11:52:22 -0700, fabdeb wrote:
the first: what is the differences between a function and a classe?

A class bundles data and functions into one object.
In which case i should use a function ?
In which case i should use a class ?

If you have several functions that operate on the same data it might make
sense to put all into a class to treat them as one "unit".
The second: there is some pincipals gui toolkit: tkinter , Python Mega-
Widgets, PyGTK, PyQt, FxPy, WxPy
what are the advantages of each one, and in which case i use each of
them?

`Tkinter` is part of the standard library. If you use that or one of the
others is a matter of taste to some degree. In a GNOME environment PyGTK
may look more natural, under KDE a PyQt or PyKDE based GUI may feel more
"native". Another factor for a decision might be the license of the GUI
toolkit.

Ciao,
Marc 'BlackJack' Rintsch
Thanks for all your links and responses .
I have a better comprehension of what i have to do for my program.

Oct 18 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Jeffrey Barish | last post: by
5 posts views Thread by Titi Anggono | last post: by
6 posts views Thread by Peter Milliken | last post: by
40 posts views Thread by =?iso-8859-1?B?QW5kcuk=?= | last post: by
9 posts views Thread by jay | last post: by
8 posts views Thread by Krypto | last post: by
8 posts views Thread by karthikbalaguru | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.