Building a Python app with Mozilla

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thorsten Kampe

    Building a Python app with Mozilla

    Hi,

    I've already sent this to the Komodo mailing list (which seemed to me
    the more appropriate place) but unfortunately I got no response.

    I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
    PyQT are actually what I want (because the lack of GUI builders and
    they don't really look good on Windows and Linux).

    Komodo itself is an excellent example of a - at least Python driven -
    application that looks superb and has superior functionality so it
    seems natural to use the Komodo approach for me.

    Some questions

    * Is there a simple How-To how to build a very simple (Python) app
    with the Mozilla framework? Kind of "Hello world"...?

    * Is is reasonable to think that building a GUI with Mozilla is easier
    than using Python frameworks because Mozilla does most of the GUI
    work?


    Thorsten
  • Josiah Carlson

    #2
    Re: Building a Python app with Mozilla

    Thorsten Kampe wrote:
    Hi,
    >
    I've already sent this to the Komodo mailing list (which seemed to me
    the more appropriate place) but unfortunately I got no response.
    >
    I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
    PyQT are actually what I want (because the lack of GUI builders and
    they don't really look good on Windows and Linux).
    You apparently didn't look very hard. On the wxPython end of things
    (which I have experience with), there is wxGlade, XRCed, Boa
    Constructor, Dabo, etc. I don't know about Tkinter (I don't use it),
    but I know that at least Qt has a very nice GUI designer and builder
    (from Trolltech if you are willing to pay for it), and if I remember
    correctly, Eric4 offers some tools to make PyQt editing nice and
    friendly. I'm sure there are others.

    As for wxPython applications not looking good on all platforms; I hate
    to break it to you, but the majority of the controls are *native* on
    whatever platform you happen to be using (except for Qt-based frontends
    in *nix, wxPython uses a Gtk binding in *nix). Take a browse through a
    few of the applications listed in the wiki:
    http://wiki.wxpython.org/wxPythonPit_Apps , or even Andrea Gavana's
    custom widgets http://xoomer.alice.it/infinity77/eng/freeware.html .

    Komodo itself is an excellent example of a - at least Python driven -
    application that looks superb and has superior functionality so it
    seems natural to use the Komodo approach for me.
    I could have sworn that Komodo was written in PyQt. Unless my memory is
    failing me (doubtful, as they at least used to offer some PyQt
    development tools), I would imagine they merely embedded the mozilla
    bits and pieces with some C extensions.

    In any case, you really don't want to be developing an application using
    XPI. According to everyone I've ever talked to about XPI, while getting
    the basic stuff working isn't bad, doing anything worth mentioning is
    about as big a pain in the butt than just writing everything in 8088
    assembly. You mileage may vary of course.

    * Is there a simple How-To how to build a very simple (Python) app
    with the Mozilla framework? Kind of "Hello world"...?
    Maybe. Search terms you should use are 'embed XPI python', which give
    me about 189k results in google, some of which seem applicable on the
    first page (which also leads me to believe that my statements regarding
    Komodo embedding mozilla technology may be right, though maybe they
    wrote Komodo in C and Qt).

    * Is is reasonable to think that building a GUI with Mozilla is easier
    than using Python frameworks because Mozilla does most of the GUI
    work?
    Doubtful. Building a GUI app with XRCed and wxPython is pretty easy if
    you understand Python and object-oriented programming. There are some
    annoying vagaries with events, but if you ask your questions on the
    wxpython-users mailing list (over at wxpython.org), one of at least a
    half-dozen people will likely answer your question.


    - Josiah

    Comment

    • Diez B. Roggisch

      #3
      Re: Building a Python app with Mozilla

      You apparently didn't look very hard. On the wxPython end of things
      (which I have experience with), there is wxGlade, XRCed, Boa
      Constructor, Dabo, etc. I don't know about Tkinter (I don't use it),
      but I know that at least Qt has a very nice GUI designer and builder
      (from Trolltech if you are willing to pay for it), and if I remember
      correctly, Eric4 offers some tools to make PyQt editing nice and
      friendly. I'm sure there are others.
      You're somewhat wrong regarding Qt. The designer is free (I did never
      use a commercial Qt, maybe there comes something additional - but IF I
      don't have the faintest idea what it could do that would make it better
      than the free designer.)

      And eric is cool and integrates with Qt (and is an example of a Qt-app
      itself), via launching the designer - but it hasn't have any
      gui-building stuff in there.

      Diez

      Comment

      • Diez B. Roggisch

        #4
        Re: Building a Python app with Mozilla

        Thorsten Kampe schrieb:
        Hi,
        >
        I've already sent this to the Komodo mailing list (which seemed to me
        the more appropriate place) but unfortunately I got no response.
        >
        I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
        PyQT are actually what I want (because the lack of GUI builders and
        they don't really look good on Windows and Linux).
        The latter statement is bogus. Qt is THE native look on KDE. GTK for
        Gnome. So how is it not "looking good on linux"?

        And as it has been said in this thread already, Qt has an excellent free
        GUI-builder.

        Diez

        Comment

        • Sebastian Wiesner

          #5
          Re: Building a Python app with Mozilla

          [ "Diez B. Roggisch" <deets@nospam.w eb.de]
          And as it has been said in this thread already, Qt has an excellent free
          GUI-builder.
          Free as long as you develop free software. Development of proprietary,
          non-gpl software with Qt requires a commercial licence from Trolltech.

          --
          Freedom is always the freedom of dissenters.
          (Rosa Luxemburg)

          -----BEGIN PGP SIGNATURE-----
          Version: GnuPG v2.0.4 (GNU/Linux)

          iD8DBQBGhj8qn3I EGILecb4RAlXPAJ 0QjaG0CpKAr9uz7 diDGhv6BEPLfACe N63U
          bWL/mJWyqO940cQg9uz awVw=
          =u938
          -----END PGP SIGNATURE-----

          Comment

          • Kevin Walzer

            #6
            Re: Building a Python app with Mozilla

            Thorsten Kampe wrote:
            Hi,
            >
            I've already sent this to the Komodo mailing list (which seemed to me
            the more appropriate place) but unfortunately I got no response.
            >
            I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
            PyQT are actually what I want (because the lack of GUI builders and
            they don't really look good on Windows and Linux).
            >
            Komodo itself is an excellent example of a - at least Python driven -
            application that looks superb and has superior functionality so it
            seems natural to use the Komodo approach for me.
            >
            Komodo is not a Python application. It is a Mozilla application that
            supports Python development. Komodo is more akin to Thunderbird and
            Firefox than anything else; it uses the XUL framework for rendering
            widgets, if I'm not mistaken. If you want to build an application like
            Komodo, get a book on developing with the Mozilla framework (XUL, XPCOM,
            and all that) and look at that. Python has little to do with that.

            --
            Kevin Walzer
            Code by Kevin

            Comment

            • Diez B. Roggisch

              #7
              Re: Building a Python app with Mozilla

              Sebastian Wiesner schrieb:
              [ "Diez B. Roggisch" <deets@nospam.w eb.de]
              >And as it has been said in this thread already, Qt has an excellent free
              >GUI-builder.
              >
              Free as long as you develop free software. Development of proprietary,
              non-gpl software with Qt requires a commercial licence from Trolltech.
              The OP did debuke Qt because of a lack of a gui-builder, not because of
              it's licensing.

              Diez

              Comment

              • Sebastian Wiesner

                #8
                Re: Building a Python app with Mozilla

                [ "Diez B. Roggisch" <deets@nospam.w eb.de]
                I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
                PyQT are actually what I want (because the lack of GUI builders and
                they don't really look good on Windows and Linux).
                >
                The latter statement is bogus. Qt is THE native look on KDE. GTK for
                Gnome. So how is it not "looking good on linux"?
                I guess, "not looking good on linux" refers to Tkinter, which is in fact
                really ugly on linux systems.
                And as it has been said in this thread already, Qt has an excellent free
                GUI-builder.
                So have Gtk and WxWidgets.

                --
                Freedom is always the freedom of dissenters.
                (Rosa Luxemburg)

                -----BEGIN PGP SIGNATURE-----
                Version: GnuPG v2.0.4 (GNU/Linux)

                iD8DBQBGho+Yn3I EGILecb4RAvRzAJ wIp/lzT8O/4WwYUU/RxFQztwSUXgCdHP PZ
                X/PbnLvKbNZHbcwcQ owhnxM=
                =+nm1
                -----END PGP SIGNATURE-----

                Comment

                • Brian Quinlan

                  #9
                  Re: Building a Python app with Mozilla

                  Kevin Walzer wrote:
                  Komodo is not a Python application. It is a Mozilla application that
                  supports Python development. Komodo is more akin to Thunderbird and
                  Firefox than anything else; it uses the XUL framework for rendering
                  widgets, if I'm not mistaken. If you want to build an application like
                  Komodo, get a book on developing with the Mozilla framework (XUL, XPCOM,
                  and all that) and look at that. Python has little to do with that.
                  Most application logic in Komodo is implemented in Python, using the
                  PyXPCOM bindings. The UI is implemented using XUL and JavaScript. The
                  editor is Scintilla (C++).

                  .../Komodo Edit.app/Contents/MacOS % find . -name "*.py" | xargs wc
                  ....
                  ....
                  126392 456858 4949602 total

                  This doesn't include the python code in the Python libraries themselves.

                  Cheers,
                  Brian


                  Comment

                  • Todd Whiteman

                    #10
                    Re: Building a Python app with Mozilla

                    Thorsten Kampe wrote:
                    Hi,
                    >
                    I've already sent this to the Komodo mailing list (which seemed to me
                    the more appropriate place) but unfortunately I got no response.
                    Hi Thorsten,

                    I'm sorry that we (Komodo team) missed it, but I did not see such a
                    message on the Komodo mailing list.
                    >
                    I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
                    PyQT are actually what I want (because the lack of GUI builders and
                    they don't really look good on Windows and Linux).
                    >
                    Komodo itself is an excellent example of a - at least Python driven -
                    application that looks superb and has superior functionality so it
                    seems natural to use the Komodo approach for me.
                    >
                    Some questions
                    >
                    * Is there a simple How-To how to build a very simple (Python) app
                    with the Mozilla framework? Kind of "Hello world"...?
                    >
                    Just to detail how Komodo works, as there seems to be some confusion on
                    this:
                    * Komodo is based on top of Mozilla (like Firefox, Thunderbird,
                    Democracy, etc... )
                    * Komodo includes PyXPCOM (XPCOM bindings to the Python language), which
                    enables JavaScript and C++ components to easily interact with python
                    objects inside an embedded Python.
                    * The Komodo UI is written using XUL/JavaScript and most of the backend
                    services are written using Python code.

                    To enable the use of Python from within the Mozilla framework you'll
                    need to build mozilla with the python xpcom extension enabled.

                    For a simple overview of building and making use of PyXPCOM, see these
                    links:
                    * http://developer.mozilla.org/en/docs/PyXPCOM
                    * http://developer.mozilla.org/en/docs/Building_PyXPCOM
                    * http://developer.mozilla.org/en/docs...PCOM_component
                    * Is is reasonable to think that building a GUI with Mozilla is easier
                    than using Python frameworks because Mozilla does most of the GUI
                    work?
                    >
                    I would not recommend this for a small project, as there are many build
                    related issues (especially since you'll need to build a separate
                    Mozilla/XulRunner application for every platform you support) and a
                    steeper learning curve for getting an application like this to work,
                    packaged and installable.

                    Yes, it is definitely a lot easier to build the UI using XUL and it does
                    look consistently better across multiple platforms.

                    Using Mozilla you'll gain access to a wealth of components with which
                    you can take advantage of within your application.

                    Note also that for the Firefox 3 codebase, it is expected that Python
                    will become usable in the XUL UI, so instead of writing JavaScript
                    you'll be able to write Python code that accesses and manipulates the
                    user interface and the DOM.

                    Cheers,
                    Todd

                    Comment

                    • sjdevnull@yahoo.com

                      #11
                      Re: Building a Python app with Mozilla

                      Thorsten Kampe wrote:
                      Hi,
                      >
                      I've already sent this to the Komodo mailing list (which seemed to me
                      the more appropriate place) but unfortunately I got no response.
                      >
                      I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
                      PyQT are actually what I want (because the lack of GUI builders and
                      they don't really look good on Windows and Linux).
                      >
                      Komodo itself is an excellent example of a - at least Python driven -
                      application that looks superb
                      I dunno about Windows, but on Linux Komodo/Firefox/etc stick out like
                      a sore thumb with their ugly, non-native looking widgets (idem. Tk).
                      wxWidgets will give you native looking apps on both Linux and Windows
                      (and I think on Macs as well but it's been a while since I looked).

                      Comment

                      • tleeuwenburg@gmail.com

                        #12
                        Re: Building a Python app with Mozilla

                        On Jul 4, 2:48 pm, "sjdevn...@yaho o.com" <sjdevn...@yaho o.comwrote:
                        Thorsten Kampe wrote:
                        Hi,
                        >
                        I've already sent this to the Komodo mailing list (which seemed to me
                        the more appropriate place) but unfortunately I got no response.
                        >
                        I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
                        PyQT are actually what I want (because the lack of GUI builders and
                        they don't really look good on Windows and Linux).
                        >
                        Komodo itself is an excellent example of a - at least Python driven -
                        application that looks superb
                        >
                        I dunno about Windows, but on Linux Komodo/Firefox/etc stick out like
                        a sore thumb with their ugly, non-native looking widgets (idem. Tk).
                        wxWidgets will give you native looking apps on both Linux and Windows
                        (and I think on Macs as well but it's been a while since I looked).
                        They stick out like a grand painting at a kid's art class...

                        -T

                        Comment

                        • greg

                          #13
                          Re: Building a Python app with Mozilla

                          sjdevnull@yahoo .com wrote:
                          wxWidgets will give you native looking apps on both Linux and Windows
                          Well, maybe. There's more to getting a native feel than
                          just using the right widgets. I once saw a Qt-based app on
                          MacOSX that had tiny little buttons that were too small
                          for the text they contained -- Aqua buttons just don't
                          scale down like that. :-(

                          --
                          Greg

                          Comment

                          • Stefan Sonnenberg-Carstens

                            #14
                            Re: Building a Python app with Mozilla

                            On Do, 5.07.2007, 03:45, greg wrote:
                            sjdevnull@yahoo .com wrote:
                            >
                            >wxWidgets will give you native looking apps on both Linux and Windows
                            >
                            Well, maybe. There's more to getting a native feel than
                            just using the right widgets. I once saw a Qt-based app on
                            MacOSX that had tiny little buttons that were too small
                            for the text they contained -- Aqua buttons just don't
                            scale down like that. :-(
                            >
                            --
                            Greg
                            --

                            >
                            >
                            Qt based buttons don't either.
                            If some fool uses absolute positioning and sizing,
                            then it is not the toolkit to blame.
                            I'm using wxPython for instance and use the sizers and placeholders
                            there, so this is possible with Qt also.
                            So, perhaps (which I don't know) Aqua buttons simply don't permit
                            absolute stuff ?
                            Or the Aqua programmers read the user interface guidelines carefully ?

                            Comment

                            • Shane Geiger

                              #15
                              Re: Building a Python app with Mozilla

                              Brett Cannon was doing some work with the Firefox security model to
                              allow Python coding from within Firefox. He may have stopped doing the
                              work because it would not lead to a PhD. I am really looking forward to
                              seeing someone making this a possibility.



                              Stefan Sonnenberg-Carstens wrote:
                              On Do, 5.07.2007, 03:45, greg wrote:
                              >
                              >sjdevnull@yahoo .com wrote:
                              >>
                              >>
                              >>wxWidgets will give you native looking apps on both Linux and Windows
                              >>>
                              >Well, maybe. There's more to getting a native feel than
                              >just using the right widgets. I once saw a Qt-based app on
                              >MacOSX that had tiny little buttons that were too small
                              >for the text they contained -- Aqua buttons just don't
                              >scale down like that. :-(
                              >>
                              >--
                              >Greg
                              >--
                              >http://mail.python.org/mailman/listinfo/python-list
                              >>
                              >>
                              >>
                              Qt based buttons don't either.
                              If some fool uses absolute positioning and sizing,
                              then it is not the toolkit to blame.
                              I'm using wxPython for instance and use the sizers and placeholders
                              there, so this is possible with Qt also.
                              So, perhaps (which I don't know) Aqua buttons simply don't permit
                              absolute stuff ?
                              Or the Aqua programmers read the user interface guidelines carefully ?
                              >
                              --
                              Shane Geiger
                              IT Director
                              National Council on Economic Education
                              sgeiger@ncee.ne t | 402-438-8958 | http://www.ncee.net

                              Leading the Campaign for Economic and Financial Literacy


                              Comment

                              Working...