some questions about Python and tkinter

F

fabdeb

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
 
B

Bruno Desthuilliers

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.
 
K

kyosohma

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_oriented_framework/defining_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
 
M

Marc 'BlackJack' Rintsch

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
 
F

fabdeb

A class bundles data and functions into one object.


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".



`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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top