472,988 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,988 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 1939
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...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.