True standard Windows app in Python?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pjer Holton

    True standard Windows app in Python?

    If I were to build a Windows application that is a true standard Windows
    application in every conceivable way and that adheres to the MS Windows
    standards as much as possible (installation, GUI, printing, registry, RTF
    etc.), and if portability to other platforms is only a minor concern, ...
    would Python be a good choice?

    What packages, libraries and modules would you recommend for GUI,
    installation, data storage etc.?

    Thank you very much in advance for your advice!

    --
    Pjer.
  • Harald Massa

    #2
    Re: True standard Windows app in Python?

    Pjer,

    I use Python for sth like that.

    [color=blue]
    >GUI, printing, registry, RTF[/color]
    For GUI and Printing I use wxpython

    for registry-work I use win32all
    rtf is not standardized in any way. It is documented. But you should not
    expect the dominating word processor to adhere to this documentation. But
    .... it's only text, so it's possible to deal with it.
    [color=blue]
    >installation ,[/color]
    Installation: I just create an exe with py2exe and copy the contents of the
    distribution directory. To do this in a "Microsoft conformant way" there is
    a great bunch of installers availible; some even generate .MSI foramt.
    McMillanInstall er provides sth. quite similiar.

    Comment

    • Miki Tebeka

      #3
      Re: True standard Windows app in Python?

      Hello Pjer,[color=blue]
      > If I were to build a Windows application that is a true standard Windows
      > application in every conceivable way and that adheres to the MS Windows
      > standards as much as possible (installation, GUI, printing, registry, RTF
      > etc.), and if portability to other platforms is only a minor concern, ...
      > would Python be a good choice?
      >
      > What packages, libraries and modules would you recommend for GUI,
      > installation, data storage etc.?[/color]
      The combination I use at work is:
      Python + wxPython + win32all + py2exe + NSIS Installer.

      Works like a charm, native looking Windows application in no-time.

      HTH.
      Miki

      Comment

      • Alan Gauld

        #4
        Re: True standard Windows app in Python?

        On Sun, 28 Dec 2003 14:28:42 +0100, Pjer Holton
        <no.mail.please @se.invalid> wrote:[color=blue]
        > If I were to build a Windows application that is a true standard Windows
        > application in every conceivable way[/color]

        It depends on what the app does, there are some things you simply
        can't do with python in Windows even with winall installed. But
        then again there are things you can't do with MFC and C++. It
        depends what you are aiming for.
        [color=blue]
        > and that adheres to the MS Windows
        > standards as much as possible (installation, GUI, printing, registry, RTF
        > etc.),[/color]

        If you want to get the Windows "kite-mark" then probably Python
        is not the best solution, then again if you want to produce it
        quickly and cheaply... Pick the tool for the job. Most commercial
        apps on Windows are still written in C++ for performance reasons
        and because you get access to all the windows stiuff when you
        need it. But that comes at a significant price in terms of
        effort.
        [color=blue]
        > What packages, libraries and modules would you recommend for GUI,
        > installation, data storage etc.?[/color]

        If you do go down the Python route I'd recommend either the MFC
        stuff in winall, or maybe Qt or wxPython. They all use the native
        toolkit/API under the covers.

        Alan G.
        Author of the Learn to Program website

        Comment

        • Thomas Dorn

          #5
          Re: True standard Windows app in Python?

          On Sun, 28 Dec 2003 14:28:42 +0100, Pjer Holton wrote:[color=blue]
          >
          > If I were to build a Windows application that is a true standard Windows
          > application in every conceivable way and that adheres to the MS Windows
          > standards as much as possible (installation, GUI, printing, registry, RTF
          > etc.), and if portability to other platforms is only a minor concern, ...
          > would Python be a good choice?
          >[/color]

          In your situation (i.e. trying to build a Windows application which
          is "standard in every conceivable way"), I would not use Python.

          If you do not want to use C++ on Windows, C# (.NET) should be a
          good solution for you. You even might have a look at the Python
          for .NET solutions (in the near future).

          HTHomas

          Comment

          • Ville Vainio

            #6
            Re: True standard Windows app in Python?

            Thomas Dorn <thomas.dorn@ph reaker.net> writes:
            [color=blue]
            > In your situation (i.e. trying to build a Windows application which
            > is "standard in every conceivable way"), I would not use Python.[/color]

            Doesn't using the mfc library (like PythonWin does) enable creating
            applications that are "standard in every conceivable way"?

            --
            Ville Vainio http://www.students.tut.fi/~vainio24

            Comment

            • Thomas Dorn

              #7
              Re: True standard Windows app in Python?

              On Mon, 29 Dec 2003 15:35:56 +0200, Ville Vainio wrote:
              [color=blue]
              > Thomas Dorn <thomas.dorn@ph reaker.net> writes:
              >[color=green]
              >> In your situation (i.e. trying to build a Windows application which
              >> is "standard in every conceivable way"), I would not use Python.[/color]
              >
              > Doesn't using the mfc library (like PythonWin does) enable creating
              > applications that are "standard in every conceivable way"?[/color]

              Even if there are wrappers for things like the MFC library, I would
              not say that Python is a "good choice" for writing Windows applications
              as defined by Pjer (and Pjer was asking whether it Python is a "good
              choice" for his kind of projects or not).

              I use Python for 80%+ of my projects (mostly cross-platform) and
              would normally recommend it for almost any project; but considering
              the various Microsoft OS (incl. Longhorn) and their differences, I
              think using C#/.NET (or maybe even C++) is a better choice for some-
              one in Pjer's situation.

              Comment

              • Dave Brueck

                #8
                Re: True standard Windows app in Python?

                Thomas wrote:[color=blue]
                > On Sun, 28 Dec 2003 14:28:42 +0100, Pjer Holton wrote:[color=green]
                > >
                > > If I were to build a Windows application that is a true standard Windows
                > > application in every conceivable way and that adheres to the MS Windows
                > > standards as much as possible (installation, GUI, printing, registry, RTF
                > > etc.), and if portability to other platforms is only a minor concern, ...
                > > would Python be a good choice?
                > >[/color]
                >
                > In your situation (i.e. trying to build a Windows application which
                > is "standard in every conceivable way"), I would not use Python.[/color]

                Why?

                -Dave

                Comment

                • Dave Brueck

                  #9
                  Re: True standard Windows app in Python?

                  Thomas wrote:[color=blue]
                  > On Mon, 29 Dec 2003 15:35:56 +0200, Ville Vainio wrote:
                  >[color=green]
                  > > Thomas Dorn <thomas.dorn@ph reaker.net> writes:
                  > >[color=darkred]
                  > >> In your situation (i.e. trying to build a Windows application which
                  > >> is "standard in every conceivable way"), I would not use Python.[/color]
                  > >
                  > > Doesn't using the mfc library (like PythonWin does) enable creating
                  > > applications that are "standard in every conceivable way"?[/color]
                  >
                  > Even if there are wrappers for things like the MFC library, I would
                  > not say that Python is a "good choice" for writing Windows applications
                  > as defined by Pjer (and Pjer was asking whether it Python is a "good
                  > choice" for his kind of projects or not).[/color]

                  Why? I use Python for writing Windows applications all the time (installers,
                  registry, COM access, etc, etc) and it works really well.
                  [color=blue]
                  > I use Python for 80%+ of my projects (mostly cross-platform) and
                  > would normally recommend it for almost any project; but considering
                  > the various Microsoft OS (incl. Longhorn) and their differences, I
                  > think using C#/.NET (or maybe even C++) is a better choice for some-
                  > one in Pjer's situation.[/color]

                  Can you give a specific example of how the various OSs cause problems for
                  Python but not for other languages?

                  -Dave


                  Comment

                  • Dave Brueck

                    #10
                    Re: True standard Windows app in Python?

                    Alan wrote:[color=blue]
                    > On Sun, 28 Dec 2003 14:28:42 +0100, Pjer Holton
                    > <no.mail.please @se.invalid> wrote:
                    >
                    > If you want to get the Windows "kite-mark" then probably Python
                    > is not the best solution[/color]

                    Why? Just curious, but what specifically are you thinking of? The OP's question
                    was pretty vague, so it's hard to tell what the question was really about.
                    [color=blue]
                    > quickly and cheaply... Pick the tool for the job. Most commercial
                    > apps on Windows are still written in C++ for performance reasons[/color]

                    Hmmm... most Windows programs are purely event driven and therefore spend
                    oodles and oodles of time idle waiting for user input. If in fact most are
                    still written in C++ I'd say it has more to do with habit and/or tools like
                    Visual Studio rather than because of performance reasons.
                    [color=blue]
                    > and because you get access to all the windows stiuff when you
                    > need it.[/color]

                    That's what ctypes is for. :)

                    -Dave


                    Comment

                    • Alan Gauld

                      #11
                      Re: True standard Windows app in Python?

                      On 29 Dec 2003 15:35:56 +0200, Ville Vainio
                      <ville.vainio@s pamster_tut_rem ove.fi> wrote:[color=blue]
                      > Thomas Dorn <thomas.dorn@ph reaker.net> writes:[color=green]
                      > > In your situation (i.e. trying to build a Windows application which
                      > > is "standard in every conceivable way"), I would not use Python.[/color]
                      > Doesn't using the mfc library (like PythonWin does) enable creating
                      > applications that are "standard in every conceivable way"?[/color]

                      No, there are several things that you can do using the Win32 API
                      that you can't do with MFC. Also winall doesn't expose all of MFC
                      (last time I looked, although it does do the 80%(95%!) that you
                      need most.

                      This is especially true when you start to get into controlling
                      strange peripheral devices etc. MFC is great for standard
                      business type apps but it is not 100% complete win32 coverage.

                      Alan G.
                      Author of the Learn to Program website

                      Comment

                      • Alan Gauld

                        #12
                        Re: True standard Windows app in Python?

                        On Mon, 29 Dec 2003 13:25:56 -0700, "Dave Brueck"
                        <dave@pythonapo crypha.com> wrote:[color=blue][color=green]
                        > > If you want to get the Windows "kite-mark" then probably Python
                        > > is not the best solution[/color]
                        >
                        > Why? Just curious, but what specifically are you thinking of? The OP's question
                        > was pretty vague, so it's hard to tell what the question was really about.[/color]

                        Well for example writing a fully windows compliant screne saver
                        is impossible using Python because the MFC classes don;t give
                        access to all the functions you need. There are lots of non
                        compliant screen savers out there but they dont get the "fully
                        compliant" badge...
                        [color=blue]
                        > Hmmm... most Windows programs are purely event driven and therefore spend
                        > oodles and oodles of time idle waiting for user input. If in fact most are
                        > still written in C++ I'd say it has more to do with habit and/or tools like
                        > Visual Studio rather than because of performance reasons.[/color]

                        Consumer magazines persist in benchmatrking performance on things
                        like search/replace operations etc. You need those benchmark
                        operations to go full spped to beat the opposituion. Stupid
                        but a fact of shrinkwrap life...
                        [color=blue][color=green]
                        > > and because you get access to all the windows stiuff when you
                        > > need it.[/color]
                        >
                        > That's what ctypes is for. :)[/color]

                        Gives you access to the types but not the low level win32 APIs.
                        Of course you can write C wrappers for python, but then its no
                        longer really a Python app.

                        Alan G.
                        Author of the Learn to Program website

                        Comment

                        • Dave Brueck

                          #13
                          Re: True standard Windows app in Python?

                          Alan wrote:[color=blue][color=green][color=darkred]
                          > > > If you want to get the Windows "kite-mark" then probably Python
                          > > > is not the best solution[/color]
                          > >
                          > > Why? Just curious, but what specifically are you thinking of? The OP's[/color][/color]
                          question[color=blue][color=green]
                          > > was pretty vague, so it's hard to tell what the question was really about.[/color]
                          >
                          > Well for example writing a fully windows compliant screne saver
                          > is impossible using Python[/color]

                          You may find this link interesting then. :)


                          [color=blue][color=green][color=darkred]
                          > > > and because you get access to all the windows stiuff when you
                          > > > need it.[/color]
                          > >
                          > > That's what ctypes is for. :)[/color]
                          >
                          > Gives you access to the types but not the low level win32 APIs.[/color]

                          Are you sure you know what ctypes does? What "low level win32 APIs" are you
                          referring to?

                          -Dave


                          Comment

                          • Alan Gauld

                            #14
                            Re: True standard Windows app in Python?

                            On Mon, 29 Dec 2003 15:39:26 -0700, "Dave Brueck"
                            <dave@pythonapo crypha.com> wrote:[color=blue][color=green]
                            > > Well for example writing a fully windows compliant screne saver
                            > > is impossible using Python[/color]
                            >
                            > You may find this link interesting then. :)
                            >
                            > http://homepage.hispeed.ch/py430/python/index.html[/color]

                            Actually that's pretty darned impressive but from scanning the
                            code its not fully windows compliant because it doesn't include
                            the code to cover all the standard corner mouse clicks or
                            keyboard shortcuts, neither is it plumbed into the GINA(?)
                            security module so far as I can tell to enable password control.
                            But OTOH that should be possible...

                            Now I confess I didn't install it and run it so maybe I'm doing
                            it an injustice. But certainly when I looked at writing a screen
                            saver I gave up when I discovered I couldn't even do it using
                            pure MFC, I had to drop into raw Win32... But I'm a wimp when it
                            comes to such things ;-)
                            [color=blue][color=green]
                            > > Gives you access to the types but not the low level win32 APIs.[/color]
                            >
                            > Are you sure you know what ctypes does? What "low level win32 APIs" are you
                            > referring to?[/color]

                            The win32 API calls that sit below MFC. In particular the device
                            IO ones for talking to PCI cards and the like.

                            And you are right I didn't realize all that ctypes could do, I'd
                            only seen it as a wrapper around the C typesystem - as per the
                            name! I didn't know, till now, that you could access DLL
                            functions, so in principle(albei t painfully) you should be able
                            to access all of the win32 API.

                            So yes, you could use Python to write a full windows compliant
                            program, OTOH I'm still not sure that I'd want to write C in
                            Python! :-)

                            Alan g.
                            Author of the Learn to Program website

                            Comment

                            • Dave Brueck

                              #15
                              Re: True standard Windows app in Python?

                              Alan wrote:[color=blue][color=green][color=darkred]
                              > > > Well for example writing a fully windows compliant screne saver
                              > > > is impossible using Python[/color]
                              > >
                              > > You may find this link interesting then. :)
                              > >
                              > > http://homepage.hispeed.ch/py430/python/index.html[/color]
                              >
                              > Actually that's pretty darned impressive but from scanning the
                              > code its not fully windows compliant because it doesn't include
                              > the code to cover all the standard corner mouse clicks or
                              > keyboard shortcuts, neither is it plumbed into the GINA(?)
                              > security module so far as I can tell to enable password control.
                              > But OTOH that should be possible...[/color]

                              Yes - it's most definitely possible. I don't blame the author of that code for
                              not doing it of course.
                              [color=blue][color=green][color=darkred]
                              > > > Gives you access to the types but not the low level win32 APIs.[/color]
                              > >
                              > > Are you sure you know what ctypes does? What "low level win32 APIs" are you
                              > > referring to?[/color]
                              >
                              > The win32 API calls that sit below MFC.[/color]

                              These are very easily accessible via ctypes (I don't use MFC at all).
                              [color=blue]
                              > In particular the device
                              > IO ones for talking to PCI cards and the like.[/color]

                              If they are standard Win32 APIs, then they are accessible. If they aren't
                              standard Win32 APIs, then they don't fit inside the definition of a "true
                              standard Windows app" anyway.
                              [color=blue]
                              > And you are right I didn't realize all that ctypes could do, I'd
                              > only seen it as a wrapper around the C typesystem - as per the
                              > name! I didn't know, till now, that you could access DLL
                              > functions, so in principle(albei t painfully) you should be able
                              > to access all of the win32 API.[/color]

                              Not too painfully, actually. The biggest hurdle is creating the Python version
                              of the structures that get passed around, but that's a one-time hit - after
                              that it's straightforward .
                              [color=blue]
                              > So yes, you could use Python to write a full windows compliant
                              > program, OTOH I'm still not sure that I'd want to write C in
                              > Python! :-)[/color]

                              Well, I guess that depends. I've been using ctypes almost daily for a year or
                              so and now I find it annoying to do Win32 programming in C! It's not that
                              you're writing C in Python as Win32 programming mostly populating structures,
                              calling functions, and checking error codes - very little of it is actually
                              language-specific or "normal" C code; rather, it's tedious work in all
                              languages, so in Python it's nice because you cut out the tediousness of C and
                              have just the tediousness of Win32 left. ;-)

                              -Dave


                              Comment

                              Working...