473,289 Members | 1,959 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

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 1967
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Edilmar | last post by:
Hi, First of all, I'm new in Python... I have worked with manu langs and IDEs, like Delphi, VB, JBuilder, Eclipse, Borland C++, Perl, etc... Then, today I think IDEs like Delphi have a...
14
by: Jeffrey Barish | last post by:
Since upgrading to python 2.4 yesterday, I am no longer able to use Tkinter. From http://www.python.org/moin/TkInter I learned that I need to edit Modules/Setup to include Tkinter during the make....
5
by: Titi Anggono | last post by:
Hi all, I have some questions: 1. Can we use Tkinter for web application such as Java ? 2. I use gnuplot.py module for interfacing with gnuplot in linux. Can we make the plot result shown in...
6
by: Peter Milliken | last post by:
Hi, I (think I have :-)) installed Python on my Pocket PC (obtained from http://fore.validus.com/~kashtan/). There were Tkinter binaries with it so I installed those as well. When I attempt...
40
by: =?iso-8859-1?B?QW5kcuk=?= | last post by:
I'm really annoyed at Python - and not for the reasons already mentioned on this list. Everyone know that programming is supposed to be a dark art, nearly impossible to learn. Computer code is...
9
by: jay | last post by:
Hi, I'm totally new to Python and was hoping someone might be able to answer a few questions for me: 1. What are your views about Python vs Perl? Do you see one as better than the other? ...
8
by: Krypto | last post by:
Hi, I have used Python for a couple of projects last year and I found it extremely useful. I could write two middle size projects in 2-3 months (part time). Right now I am a bit rusty and trying...
13
by: Daniel Fetchinson | last post by:
Was looking at PEP 3108, http://www.python.org/dev/peps/pep-3108/ , Is it just me or others also think that it would be a major loss to remove tkinter from the python core? PEP 3108 starts off...
8
by: karthikbalaguru | last post by:
Hi, One of my python program needs tkinter to be installed to run successfully. I am using Redhat 9.0 and hence tried installing by copying the tkinter-2.2.2-36.i386.rpm alone from the CD 3 to...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.