473,387 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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.
Jul 18 '05 #1
16 1925
Pjer,

I use Python for sth like that.

GUI, printing, registry, RTF 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.
installation,

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.
McMillanInstaller provides sth. quite similiar.

Jul 18 '05 #2
Hello Pjer,
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.?

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
Jul 18 '05 #3
On Sun, 28 Dec 2003 14:28:42 +0100, Pjer Holton
<no************@se.invalid> wrote:
If I were to build a Windows application that is a true standard Windows
application in every conceivable way
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.
and that adheres to the MS Windows
standards as much as possible (installation, GUI, printing, registry, RTF
etc.),
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.
What packages, libraries and modules would you recommend for GUI,
installation, data storage etc.?


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
http://www.freenetpages.co.uk/hp/alan.gauld
Jul 18 '05 #4
On Sun, 28 Dec 2003 14:28:42 +0100, Pjer Holton wrote:

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?


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

Jul 18 '05 #5
Thomas Dorn <th*********@phreaker.net> writes:
In your situation (i.e. trying to build a Windows application which
is "standard in every conceivable way"), I would not use Python.


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
Jul 18 '05 #6
On Mon, 29 Dec 2003 15:35:56 +0200, Ville Vainio wrote:
Thomas Dorn <th*********@phreaker.net> writes:
In your situation (i.e. trying to build a Windows application which
is "standard in every conceivable way"), I would not use Python.


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


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.
Jul 18 '05 #7
Thomas wrote:
On Sun, 28 Dec 2003 14:28:42 +0100, Pjer Holton wrote:

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?


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


Why?

-Dave

Jul 18 '05 #8
Thomas wrote:
On Mon, 29 Dec 2003 15:35:56 +0200, Ville Vainio wrote:
Thomas Dorn <th*********@phreaker.net> writes:
In your situation (i.e. trying to build a Windows application which
is "standard in every conceivable way"), I would not use Python.
Doesn't using the mfc library (like PythonWin does) enable creating
applications that are "standard in every conceivable way"?


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).


Why? I use Python for writing Windows applications all the time (installers,
registry, COM access, etc, etc) and it works really well.
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.


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

-Dave
Jul 18 '05 #9
Alan wrote:
On Sun, 28 Dec 2003 14:28:42 +0100, Pjer Holton
<no************@se.invalid> wrote:

If you want to get the Windows "kite-mark" then probably Python
is not the best solution
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.
quickly and cheaply... Pick the tool for the job. Most commercial
apps on Windows are still written in C++ for performance reasons
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.
and because you get access to all the windows stiuff when you
need it.


That's what ctypes is for. :)

-Dave
Jul 18 '05 #10
On 29 Dec 2003 15:35:56 +0200, Ville Vainio
<ville.vainio@spamster_tut_remove.fi> wrote:
Thomas Dorn <th*********@phreaker.net> writes:
In your situation (i.e. trying to build a Windows application which
is "standard in every conceivable way"), I would not use Python.

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


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
http://www.freenetpages.co.uk/hp/alan.gauld
Jul 18 '05 #11
On Mon, 29 Dec 2003 13:25:56 -0700, "Dave Brueck"
<da**@pythonapocrypha.com> wrote:
If you want to get the Windows "kite-mark" then probably Python
is not the best solution
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.


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...
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.


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...
and because you get access to all the windows stiuff when you
need it.


That's what ctypes is for. :)


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
http://www.freenetpages.co.uk/hp/alan.gauld
Jul 18 '05 #12
Alan wrote:
If you want to get the Windows "kite-mark" then probably Python
is not the best solution


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.


Well for example writing a fully windows compliant screne saver
is impossible using Python


You may find this link interesting then. :)

http://homepage.hispeed.ch/py430/python/index.html
and because you get access to all the windows stiuff when you
need it.


That's what ctypes is for. :)


Gives you access to the types but not the low level win32 APIs.


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

-Dave
Jul 18 '05 #13
On Mon, 29 Dec 2003 15:39:26 -0700, "Dave Brueck"
<da**@pythonapocrypha.com> wrote:
Well for example writing a fully windows compliant screne saver
is impossible using Python


You may find this link interesting then. :)

http://homepage.hispeed.ch/py430/python/index.html


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 ;-)
Gives you access to the types but not the low level win32 APIs.


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


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(albeit 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
http://www.freenetpages.co.uk/hp/alan.gauld
Jul 18 '05 #14
Alan wrote:
Well for example writing a fully windows compliant screne saver
is impossible using Python
You may find this link interesting then. :)

http://homepage.hispeed.ch/py430/python/index.html


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...


Yes - it's most definitely possible. I don't blame the author of that code for
not doing it of course.
Gives you access to the types but not the low level win32 APIs.


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


The win32 API calls that sit below MFC.


These are very easily accessible via ctypes (I don't use MFC at all).
In particular the device
IO ones for talking to PCI cards and the like.
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.
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(albeit painfully) you should be able
to access all of the win32 API.
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.
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! :-)


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
Jul 18 '05 #15
On Mon, 29 Dec 2003 18:15:55 -0700, "Dave Brueck"
<da**@pythonapocrypha.com> wrote:
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! :-)
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


That's true, I guess I really meant that I don't want to program
Win32, period! :-)
have just the tediousness of Win32 left. ;-)


I'm happy to write slightly non compliant apps using the GUI
toolkits and live a happier life... Even when my job involved
writing "real Windows" stuff I used Delphi rather than C/C++ life
is just too short! :-)
Alan G.
Author of the Learn to Program website
http://www.freenetpages.co.uk/hp/alan.gauld
Jul 18 '05 #16
al********@btinternet.com (Alan Gauld) writes:
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.


This was also addressed in some of the other responses, but I had to
mention that I found it interesting that it would appear that your
past experience yields a perspective that Windows programming is MFC,
with the Win32 API being a really low layer interface. Anything
outside of MFC support is a "strange peripheral device"? :-)

From my perspective, MFC is a particular high level GUI package that
you might or might not use, but the Win32 API is definitely the way to
program for Windows. I've rarely ended up using MFC (and never since
moving to Python/wxPython), but I did and still do use the Win32 API
all of the time (whether from Python or other languages). True, Win32
is lower level than MFC, but to me, it's the normal level, rather than
a low level (low level on Windows would be the kernel or device driver
interfaces).

And since I can get to the Win32 API in general (even if not wrapped
with win32all, there's the older calldll and the newer ctypes), I
always figured there was very little that that Python couldn't do
under Windows if I needed it. But again, that's thinking of the Win32
API and ignoring MFC entirely.

Anyway, I just found it interesting how past experience (and the sorts
of apps we've probably worked on) can bias a viewpoint to what it
means to program for a specific system.

For the obligatory in-context comment, for me, I cover true standard
Windows apps with Python+wxPython+installer+InnoSetup.

-- David
Jul 18 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

46
by: Scott Chapman | last post by:
There seems to be an inconsistency here: Python 2.3.2 (#1, Oct 3 2003, 19:04:58) on linux2 >>> 1 == True True >>> 3 == True False >>> if 1: print "true" ....
1
by: Mark McEahern | last post by:
I just wrote a very simple wrapper for the PayFlow Pro SDK (see below). A friend of mine did this before, but I didn't have access to his source, so I took it as a learning opportunity for me to...
18
by: Nicola Mingotti | last post by:
Hi , I obtained this result : ------ >>> '1' > 1 True ------ with python2.2.3 and 2.3.3 . (Yes , in python 2.2 i get 1 instead of True)
15
by: Ville Vainio | last post by:
Pythonic Nirvana - towards a true Object Oriented Environment ============================================================= IPython (by Francois Pinard) recently (next release - changes are...
51
by: Reinhold Birkenfeld | last post by:
Hello, at the moment python-dev is discussing including Jason Orendorff's path module into the standard library. Do you have any other good and valued Python modules that you would think are...
90
by: John Salerno | last post by:
I'm a little confused. Why doesn't s evaluate to True in the first part, but it does in the second? Is the first statement something different? False print 'hi' hi Thanks.
9
by: cniharral | last post by:
Hi, I'm interested in printing out coloured lines of my application and I don't know what to use. Can anybody give me an idea?? Regards. Carlos Niharra López
10
by: John Nagle | last post by:
Here are three network-related exceptions. These were caught by "except" with no exception type, because none of the more specific exceptions matched. This is what a traceback produced: 1....
2
by: Kevin D. Smith | last post by:
I would like to move files and directories to the Recycle Bin on Windows from Python. I have found some older articles describing how to do this, but they require additional packages to be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.