some questions about Python and tkinter

Discussion in 'Python' started by fabdeb, Oct 16, 2007.

  1. fabdeb

    fabdeb Guest

    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
    fabdeb, Oct 16, 2007
    #1
    1. Advertising

  2. 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.
    Bruno Desthuilliers, Oct 16, 2007
    #2
    1. Advertising

  3. fabdeb

    Guest

    On Oct 16, 1:52 pm, fabdeb <> wrote:
    > 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
    , Oct 16, 2007
    #3
  4. 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
    Marc 'BlackJack' Rintsch, Oct 16, 2007
    #4
  5. fabdeb

    fabdeb Guest

    On Oct 16, 9:17 pm, Marc 'BlackJack' Rintsch <> wrote:
    > 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.
    fabdeb, Oct 18, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Epler
    Replies:
    0
    Views:
    495
    Jeff Epler
    Aug 20, 2004
  2. Jeff Epler
    Replies:
    0
    Views:
    443
    Jeff Epler
    Aug 23, 2004
  3. Pierre Dagenais
    Replies:
    0
    Views:
    297
    Pierre Dagenais
    Aug 3, 2008
  4. Hidekazu IWAKI
    Replies:
    1
    Views:
    365
    Peter Otten
    Dec 14, 2009
  5. Hidekazu IWAKI
    Replies:
    0
    Views:
    515
    Hidekazu IWAKI
    Dec 15, 2009
Loading...

Share This Page