473,513 Members | 4,022 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1980
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
13667
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 excelent environment to develop apps with little time. I saw many people talking about Python like a easy lang to learn and to develop. But I have look...
14
3631
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. However, it isn't clear to me what modifications to make. I am supposed to specify directories in which needed files can be found. I found the...
5
1492
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 web ? I tried using cgi, and it didn't work.
6
2433
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 to run the most simplistic of python programs using Tkinter, I get an error message stating that Python can't find any tkinter module. Any ideas...
40
2686
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 supposed to be something impossible to read to the common person and yet reveal their secrets to the initiated - just remember the code displayed in...
9
1485
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? 2. Is there a good book to start with while learning Python? I'm currently reading 'Python Essential Reference' by David M. Beazley.
8
7958
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 to catch up again with Python. I am now appearing for Job Interviews these days and I am wondering if anybody of you appeared for a Python...
13
3333
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 with: Each module to be removed needs to have a justification as to why it should no longer be distributed with Python. then goes on with,
8
3267
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 my pc. But, it is not getting installed and is failing by throwing the below errors. Should i need to configure / install any specific files for...
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7543
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5703
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4757
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3239
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.