GUI Frameworks in Python?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richie Hindle

    #16
    Re: GUI Frameworks in Python?


    [Peter][color=blue]
    > I'm curious about the differences with wxPython. Three seconds seems
    > unusually long when on a slightly slower machine I can do it in well
    > under a second. Was that the first time you ran it? Many other apps
    > open? I have over 256MB RAM free when I try this...[/color]

    I tried it on this 3GHz 1GB XP box and it took 3.5 seconds to bring up the
    wxPython demo's splash banner. That was with lots of other stuff running and
    not having run it before during this session, but with plenty of available RAM
    and nothing soaking the processor. Try it after a clean boot or a good long
    disk-cache-hammering spell of doing something else - you might find it's
    slower than you think.

    --
    Richie Hindle
    richie@entrian. com


    Comment

    • Peter Maas

      #17
      Re: GUI Frameworks in Python?

      Peter Hansen wrote:[color=blue]
      > The first time I launched IDLE, it took almost three seconds. (I don't
      > have the Python installer compile .py files ahead of time.) After that
      > it takes about one second as well.[/color]

      Compiling is not the problem. The time for first launch is spent
      for loading ~ 10 MB of executables into memory. I tried this
      on my Win2000, 800 MHz, 256 MByte computer:

      - start wxpython app (stand alone tree.py from the demo): ~ 3-4 sec
      - repeat start: < 1 sec
      - delete *.pyc, repeat start: < 1 sec
      - reboot, repeat start with *.pyc: ~ 3-4 sec

      I was watching system performance simultaneously and noticed a
      decrease of free RAM memory by ~ 10 MB on starting and the same
      increase on stopping. But the dlls - once loaded - apparently
      are kept in RAM.

      Mit freundlichen Gruessen,

      Peter Maas

      --
      -------------------------------------------------------------------
      Peter Maas, M+R Infosysteme, D-52070 Aachen, Hubert-Wienen-Str. 24
      Tel +49-241-93878-0 Fax +49-241-93878-20 eMail peter.maas@mplu sr.de
      -------------------------------------------------------------------

      Comment

      • Peter Hansen

        #18
        Re: GUI Frameworks in Python?

        Richie Hindle wrote:[color=blue]
        > [Peter]
        >[color=green]
        >>I'm curious about the differences with wxPython. Three seconds seems
        >>unusually long when on a slightly slower machine I can do it in well
        >>under a second. Was that the first time you ran it? Many other apps
        >>open? I have over 256MB RAM free when I try this...[/color]
        >
        >
        > I tried it on this 3GHz 1GB XP box and it took 3.5 seconds to bring up the
        > wxPython demo's splash banner. That was with lots of other stuff running and
        > not having run it before during this session, but with plenty of available RAM
        > and nothing soaking the processor. Try it after a clean boot or a good long
        > disk-cache-hammering spell of doing something else - you might find it's
        > slower than you think.[/color]

        Something's wrong with your box then. :-)

        Rebooted. No wxPython apps run first. Clicked on Demo icon and said
        "one thousand and wuh--" and the splash banner appeared. Run it again
        and I get as far as "one thou--", so clearly there is some difference
        between the two and it's not pilot error. (Barring the possibility,
        which always exists, that it still _is_ pilot error. :-)

        Go figure. (And as I said this is an AMD 2200 with 512MB RAM, XP Pro.)

        -Peter

        Comment

        • Riccardo Attilio Galli

          #19
          Re: GUI Frameworks in Python?

          On Tue, 30 Mar 2004 14:35:20 +0100, Hugh Macdonald wrote:
          [color=blue]
          > On 30 Mar 2004 05:18:58 -0800
          > michael@foord.n et (Fuzzyman) wrote:
          >[color=green]
          >> 'Programming Python' has an excellent introduction.. so I started with
          >> Tkinter thinking that when I hit restrictions I could move onto wx. I
          >> haven't yet reached the point where Tkinter restricts me. Whereas
          >> there are a couple of widgets missing from the standard distribution,
          >> Tkinter *can* be used to make clean and modern looking interfaces.....
          >> And the syntax isn't too gawky once you've climbed the initial
          >> learning curve.[/color]
          >
          > For me, the issue with TK is less the restrictions it imposes and more the way of writing it in the first place.
          >[color=green][color=darkred]
          >> > GTK: Unknown - I'm looking into it today
          >> >[/color]
          >>
          >> Is this Linux only ?
          >> (pardon my terrible ignorance...)[/color]
          >
          > Yeah - it is... I'n only developing for Linux here...[/color]

          It's false.
          I'm developping a gtk program which run in both linux and windows.

          lopster, a peer-to-peer sharing programs, it's developped with gtk, and it
          runs on windows too.

          Ciao,
          Riccardo

          --
          -=Riccardo Galli=-

          _,e.
          s~ ``
          ~@. ideralis Programs
          .. ol
          `**~ http://www.sideralis.net

          Comment

          • Riccardo Attilio Galli

            #20
            Re: GUI Frameworks in Python?

            On Tue, 30 Mar 2004 16:11:55 +0800, Phipps Xue wrote:
            [color=blue]
            > pyGTK is also a good GUI frameworks but it's not available now for windows
            > platform. I suppose it's its most important shortage.[/color]

            ???
            I'm using it to develop a linux/windows app.
            And it works.

            Ciao,
            Riccardo

            --
            -=Riccardo Galli=-

            _,e.
            s~ ``
            ~@. ideralis Programs
            .. ol
            `**~ http://www.sideralis.net

            Comment

            • Hugh Macdonald

              #21
              Re: GUI Frameworks in Python?

              On Tue, 30 Mar 2004 20:21:58 +0200
              Riccardo Attilio Galli <riccardo_cut-me@cut.me.sider alis.net> wrote:

              [color=blue][color=green][color=darkred]
              > >> > GTK: Unknown - I'm looking into it today
              > >> >
              > >>
              > >> Is this Linux only ?
              > >> (pardon my terrible ignorance...)[/color]
              > >
              > > Yeah - it is... I'n only developing for Linux here...[/color]
              >
              > It's false.
              > I'm developping a gtk program which run in both linux and windows.[/color]

              Sorry - when I answered the original question I thought he was asking if I was developing for Linux only... looking back, I have no idea why I got that idea....

              --
              Hugh Macdonald
              The Moving Picture Company

              Comment

              • Hugh Macdonald

                #22
                Re: GUI Frameworks in Python?

                On Tue, 30 Mar 2004 10:58:58 -0500
                Peter Hansen <peter@engcorp. com> wrote:
                [color=blue]
                > Rebooted. No wxPython apps run first. Clicked on Demo icon and said
                > "one thousand and wuh--" and the splash banner appeared. Run it again
                > and I get as far as "one thou--", so clearly there is some difference
                > between the two and it's not pilot error.[/color]

                I just wrote the following simple script:

                -------------------------------------------------
                #!/software/python/python2.2.2/linux/bin/python
                import time
                startTime = time.time()
                from wxPython.wx import *
                print "Time:",time.ti me()-startTime
                -------------------------------------------------

                On running multiple times, I get the following outputs:

                Time: 4.60863804817
                Time: 3.26165890694
                Time: 3.24744296074
                Time: 3.26767706871
                Time: 3.25304102898

                Definately something going on here..... going to try a reboot....

                --
                Hugh Macdonald
                The Moving Picture Company

                Comment

                • Peter Hansen

                  #23
                  Re: GUI Frameworks in Python?

                  Hugh Macdonald wrote:
                  [color=blue]
                  > I just wrote the following simple script:
                  >
                  > -------------------------------------------------
                  > #!/software/python/python2.2.2/linux/bin/python
                  > import time
                  > startTime = time.time()
                  > from wxPython.wx import *
                  > print "Time:",time.ti me()-startTime
                  > -------------------------------------------------
                  >
                  > On running multiple times, I get the following outputs:
                  >
                  > Time: 4.60863804817
                  > Time: 3.26165890694
                  > Time: 3.24744296074
                  > Time: 3.26767706871
                  > Time: 3.25304102898[/color]

                  Running that repeatedly (sorry, can't reboot conveniently
                  right now, so can't get the first time) it takes 0.125 s
                  on my machine.

                  -Peter

                  Comment

                  • Josiah Carlson

                    #24
                    Re: GUI Frameworks in Python?

                    > I was watching system performance simultaneously and noticed a[color=blue]
                    > decrease of free RAM memory by ~ 10 MB on starting and the same
                    > increase on stopping. But the dlls - once loaded - apparently
                    > are kept in RAM.[/color]

                    That is what Windows does. Using an oft used cliche in a different
                    realm that always made me laugh, "Don't hate the player, hate the game".
                    In this case, the player is wxPython, the game is 'running on Windows'.

                    There may be some method to tell windows to evict currently unused dlls,
                    but I wouldn't hold my breath.

                    - Josiah

                    Comment

                    • Gary Herron

                      #25
                      Re: GUI Frameworks in Python?

                      On Tuesday 30 March 2004 05:35 am, Hugh Macdonald wrote:[color=blue]
                      >[color=green][color=darkred]
                      > > > GTK: Unknown - I'm looking into it today[/color]
                      > >
                      > > Is this Linux only ?
                      > > (pardon my terrible ignorance...)[/color]
                      >
                      > Yeah - it is... I'n only developing for Linux here...[/color]

                      No! GTK is most definitely cross platform. I use it on both Windows
                      and Linux with great success. And it's very consistent in the sense
                      that my GUI looks identical on both platforms. I have almost no need
                      for any platform dependent code in my GUI layout. (Unlike Tkinter and
                      wxPython where I remember having to tweek fonts and other things on a
                      platform by platform basis.)

                      Here's several pointers:



                      Gary Herron



                      Comment

                      • David M. Cooke

                        #26
                        Re: GUI Frameworks in Python?

                        At some point, Gary Herron <gherron@island training.com> wrote:
                        [color=blue]
                        > On Tuesday 30 March 2004 05:35 am, Hugh Macdonald wrote:[color=green]
                        >>[color=darkred]
                        >> > > GTK: Unknown - I'm looking into it today
                        >> >
                        >> > Is this Linux only ?
                        >> > (pardon my terrible ignorance...)[/color]
                        >>
                        >> Yeah - it is... I'n only developing for Linux here...[/color]
                        >
                        > No! GTK is most definitely cross platform. I use it on both Windows
                        > and Linux with great success. And it's very consistent in the sense[/color]

                        There's no (working) native port for Mac OS X [1], so I'd call it only mostly
                        cross-platform. You could use the X version, and run an X server, but
                        I could argue you could do the same under Windows...

                        [1] there are some partly-complete ports of GTK 1.2, but nothing for
                        GTK 2.x

                        --
                        |>|\/|<
                        /--------------------------------------------------------------------------\
                        |David M. Cooke
                        |cookedm(at)phy sics(dot)mcmast er(dot)ca

                        Comment

                        • Greg Krohn

                          #27
                          Re: GUI Frameworks in Python?

                          Peter Hansen wrote:[color=blue]
                          >
                          > The first time I launched IDLE, it took almost three seconds. (I don't
                          > have the Python installer compile .py files ahead of time.) After that
                          > it takes about one second as well.
                          >
                          > I'm curious about the differences with wxPython. Three seconds seems
                          > unusually long when on a slightly slower machine I can do it in well
                          > under a second. Was that the first time you ran it? Many other apps
                          > open? I have over 256MB RAM free when I try this...
                          >
                          > -Peter[/color]

                          Running Hugh's timing script from the command prompt, right after a
                          reboot, I get 1.1 seconds. Then on successive runs I get between 0.1 and
                          0.2 seconds. Then I ran the wx demo (without rebooting) and it was just
                          under 1.5 seconds for the splash. On successive runs it was well under 1
                          second.

                          So, maybe wxPython's not as bad as I thought. It's like my car in the
                          winter: I need to run out and start it up every few hours to make sure I
                          can make it home. ;)

                          greg

                          Comment

                          • Phipps Xue

                            #28
                            Re: GUI Frameworks in Python?

                            I'm really sorry for my ignorance of pyGTK in Windows. I've installed pyGTK
                            in my desktop by following Jon's reply message.

                            I feel it's really so cool, after run a helloworld application.

                            Phipps
                            "Phipps Xue" <phipps.xue@sap .com> wrote in message
                            news:c4ba4d$i9g $1@news1.wdf.sa p-ag.de...[color=blue]
                            > pyGTK is also a good GUI frameworks but it's not available now for windows
                            > platform. I suppose it's its most important shortage.
                            >
                            > Phipps
                            > "Hugh Macdonald" <HughMacdonald@ brokenpipefilms .com> wrote in message
                            > news:mailman.10 2.1080629227.20 120.python-list@python.org ...[color=green]
                            > > I've recently been trying out various different GUI frameworks in Python[/color]
                            > and[color=green]
                            > > was wondering if I could get your input on the pros and cons of the
                            > > different ones...
                            > >
                            > > wxPython: I love the programming side of wxPython, but I find it's just[/color][/color]
                            so[color=blue][color=green]
                            > > slow to initialise in the first place.
                            > >
                            > > Tkinter: While it's fast to load up, the syntax has never really[/color][/color]
                            appealed[color=blue]
                            > to[color=green]
                            > > me
                            > >
                            > > GTK: Unknown - I'm looking into it today
                            > >
                            > > Qt: I have yet to manage to install it on my system
                            > >
                            > > Anything else?
                            > >
                            > >
                            > > Hugh Macdonald
                            > >
                            > >[/color]
                            >
                            >[/color]


                            Comment

                            • Fuzzyman

                              #29
                              Re: GUI Frameworks in Python?

                              Hugh Macdonald <HughMacdonald@ brokenpipefilms .com> wrote in message news:<mailman.1 16.1080653744.2 0120.python-list@python.org >...[color=blue]
                              > On 30 Mar 2004 05:18:58 -0800
                              > michael@foord.n et (Fuzzyman) wrote:
                              >[color=green]
                              > > 'Programming Python' has an excellent introduction.. so I started with
                              > > Tkinter thinking that when I hit restrictions I could move onto wx. I
                              > > haven't yet reached the point where Tkinter restricts me. Whereas
                              > > there are a couple of widgets missing from the standard distribution,
                              > > Tkinter *can* be used to make clean and modern looking interfaces.....
                              > > And the syntax isn't too gawky once you've climbed the initial
                              > > learning curve.[/color]
                              >
                              > For me, the issue with TK is less the restrictions it imposes and more the way of writing it in the first place.[/color]

                              I guess there are two 'warts' :

                              callback functions are usually called without parameters.

                              Wrapping the GUI framework in a class gets round this nicely - the
                              callback function has full access to the class instance attributes.

                              The second is the way that events are triggered with an event object :
                              self.searchbox. bind('<Return>' , (lambda event: self.search()))

                              Using a lambda function to trigger a callback function gets round
                              that.

                              Once you get used to the pack order with Tk it's remarkably easy to
                              build GUIs quickly....

                              I guess for *big* applications some of the 'power' widgets might be
                              missing from the standard distribution. In that sense wx is
                              undoubtably more polished and fully featured.... But so far for me -
                              Tk has more than covered my needs without even exploring extension
                              widget sets. Apparently one of the more high powered IDEs (I forget
                              which one) is seamlessly built from Tk widgets.... but you'd never
                              realise it to look at it - so I guess the potential is there.

                              Regards,


                              Fuzzy

                              http://www.voidspace.org.uk/atlantib...thonutils.html

                              [color=blue]
                              >[color=green][color=darkred]
                              > > > GTK: Unknown - I'm looking into it today
                              > > >[/color]
                              > >
                              > > Is this Linux only ?
                              > > (pardon my terrible ignorance...)[/color]
                              >
                              > Yeah - it is... I'n only developing for Linux here...
                              >[color=green][color=darkred]
                              > > > Qt: I have yet to manage to install it on my system
                              > > >[/color]
                              > > Although *technically* cross platform, windoze users can't get a free
                              > > version... so I'm never going to bother looking at it...[/color]
                              >
                              > That doesn't bother me - everything I'm writing is for in-house use only, and would only ever be run on Linux...
                              >
                              > Thanks for everyones thoughts... I'm actually planning on sticking with wxPython for the moment. I've decided that I can live with the extra few seconds to load up, although I don't like it...[/color]

                              Comment

                              • Peter Maas

                                #30
                                Re: GUI Frameworks in Python?

                                Josiah Carlson wrote:[color=blue][color=green]
                                >> I was watching system performance simultaneously and noticed a
                                >> decrease of free RAM memory by ~ 10 MB on starting and the same
                                >> increase on stopping. But the dlls - once loaded - apparently
                                >> are kept in RAM.[/color]
                                >
                                > That is what Windows does. Using an oft used cliche in a different
                                > realm that always made me laugh, "Don't hate the player, hate the game".
                                > In this case, the player is wxPython, the game is 'running on Windows'.[/color]

                                After stopping the wxpython app Windows reports its memory share as
                                free, i.e. usable for other applications. If the same application
                                is reloaded and its binary stuff is not yet overwritten it is reused.
                                That's a good thing IMO, not a flaw. It would be nice though to
                                configure this behaviour, e.g. for testing. Perhaps there's a
                                registry spell in one of the numerous guru books for Win* but my
                                interest doesn't go this far.

                                Mit freundlichen Gruessen,

                                Peter Maas

                                --
                                -------------------------------------------------------------------
                                Peter Maas, M+R Infosysteme, D-52070 Aachen, Hubert-Wienen-Str. 24
                                Tel +49-241-93878-0 Fax +49-241-93878-20 eMail peter.maas@mplu sr.de
                                -------------------------------------------------------------------

                                Comment

                                Working...