Is there *any* real documentation to PyWin32?

B

Benoit

I understand that the Win32 has been said to be itself poorly
documented, so perhaps that the documentation that comes with the
modules is of similar quality is no coincidence. Maybe I'm still too
young in my programming to grasp the good of that documentation, but
for myself, it tells me next to nothing. Could anyone point me to
anything which may exist that does a better job of explaining the
extensions' use? I tried to take a look @ Microsoft's documentation,
but it was confusing.
 
T

Tim Golden

Benoit said:
I understand that the Win32 has been said to be itself poorly
documented, so perhaps that the documentation that comes with the
modules is of similar quality is no coincidence. Maybe I'm still too
young in my programming to grasp the good of that documentation, but
for myself, it tells me next to nothing. Could anyone point me to
anything which may exist that does a better job of explaining the
extensions' use? I tried to take a look @ Microsoft's documentation,
but it was confusing.

I think the thing is that, for most of the modules, they're simply
answering the question "How do I do <x> in Python?" where <x> is the
answer to the question "How do I do <y> in Windows?". For example:
"How do I send something to a printer in Windows?". If you Google
around a bit with that, you'll end up with things like OpenPrinter,
StartDocPrinter and so on. With a Vb/Delphi/C++ example in hand,
the pywin32 extensions usually make it possible to translate pretty
much directly into Python.

Obviously, the modules are more-or-less hand-coded/generated so
only whatever someone's[*] seen fit to include are included (and
development continues so new things do turn up). The more general
solution is ctypes, standard with Py2.5+, available as an extension
before that. That's even lower level, but does mean that if something
isn't exposed via pywin32 then you can do-it-yourself.

All this isn't really answering your question but is at least
explaining a bit why "explaining the extensions' use" is perhaps
a trivial task - they're there to expose the Microsoft API in
a slightly more Pythonic layer.

There are a few web pages around with a few hints and recipes, my
own included:

http://timgolden.me.uk/python/win32_how_do_i.html

Ultimately, though, you're at the mercy of the MS API unless
someone's already done the legwork of providing a more Pythonic
wrapper to something.

TJG

[*] And "someone" here means the selfless small team, mostly consisting
of Mark Hammond and Roger Upole, who've contributed over the years.
 
R

rurpy

I understand that the Win32 has been said to be itself poorly
documented, so perhaps that the documentation that comes with the
modules is of similar quality is no coincidence. Maybe I'm still too
young in my programming to grasp the good of that documentation, but
for myself, it tells me next to nothing. Could anyone point me to
anything which may exist that does a better job of explaining the
extensions' use? I tried to take a look @ Microsoft's documentation,
but it was confusing.

There is Mark Hammond's book [1] about python-win32 though I haven't
used it and don't know if it contains anything that would be helpful
to you.
It is rather old now but some claim that is not important. [2]

Personally I consider Python-win32 to be docware -- software that is
sufficiently difficult to use with the included free documentation
that many people will just buy the $$$ documentation. Numpy is
another prominent example of docware. A misappropriation of the good-
will value of legitimate open source software.

[1]http://www.amazon.com/Python-Programming-Win32-Windows-Programmers/
dp/1565926218/ref=sr_1_1?ie=UTF8&s=books&qid=1198165983&sr=1-1
[2]
http://groups.google.com/group/comp...tion)+group:comp.lang.python#78b1390a6f6d75b2
 
K

kyosohma

I understand that the Win32 has been said to be itself poorly
documented, so perhaps that the documentation that comes with the
modules is of similar quality is no coincidence. Maybe I'm still too
young in my programming to grasp the good of that documentation, but
for myself, it tells me next to nothing. Could anyone point me to
anything which may exist that does a better job of explaining the
extensions' use? I tried to take a look @ Microsoft's documentation,
but it was confusing.

There is Mark Hammond's book [1] about python-win32 though I haven't
used it and don't know if it contains anything that would be helpful
to you.
It is rather old now but some claim that is not important. [2]

Personally I consider Python-win32 to be docware -- software that is
sufficiently difficult to use with the included free documentation
that many people will just buy the $$$ documentation. Numpy is
another prominent example of docware. A misappropriation of the good-
will value of legitimate open source software.

[1]http://www.amazon.com/Python-Programming-Win32-Windows-Programmers/
dp/1565926218/ref=sr_1_1?ie=UTF8&s=books&qid=1198165983&sr=1-1
[2]http://groups.google.com/group/comp.lang.python/browse_thread/thread/...

The book of which you speak is still relevant since the Microsoft's
API hasn't changed much. Everything I've tried of their examples has
worked. Unfortunately, it is kind of expensive.

Mike
 
G

Gerrit Muller

(e-mail address removed) schreef:
Personally I consider Python-win32 to be docware -- software that is
sufficiently difficult to use with the included free documentation
that many people will just buy the $$$ documentation. Numpy is
another prominent example of docware. A misappropriation of the good-
will value of legitimate open source software.
<...snip...>
As others have pointed out Python-Win32 provides access to an extremely
wide range of services and programs. The main purpose is to do this in a
Pythonic was: simplifying matters, where the original interfaces are
very awkward and complicated.

Unfortunately many of these services and programs that can be accessed
in this way are themselves very poorly documented, or require indeed
expensive books. Blaming Python-Win32 is hitting the wrong group of
people entirely! You cannot expect them to document huge monsters such
as Windows XP or Vista, or the other monsters that can be automated
through COM, such as Powerpoint, Word and Excel.

I am myself automating some trivial MS-office stuff, but I am
flabbergasted by the fragmentary nature of on-line documentation in
MS-office. The real problem is that these kinds of programs are not
described at a reasonable conceptual level, making it difficult to
automate trivial tasks. In your term MS-office is docware, certainly not
Python-Win32. My experiences with Python-Win32 itself are very good.

Gerrit
 
G

Gilles Ganault

I understand that the Win32 has been said to be itself poorly
documented, so perhaps that the documentation that comes with the
modules is of similar quality is no coincidence.

PyWin32 is free, and writing extensive documentation would be a huge
undertaking. Besides, since it's mostly a one-to-one mapping between
the Win32 API and Python, it would be a bit boring to do.

Besides, few people write GUI apps with Python (there are better
alternatives like Delphi or VB), and those who do usually prefer to
use cross-platform tools like wxWidgets.

Like others have mentionned, apparently the only book available is
this:

www.oreilly.com/catalog/pythonwin32/chapter/ch12.html
 
S

sturlamolden

Like others have mentionned, apparently the only book available is
this:

www.oreilly.com/catalog/pythonwin32/chapter/ch12.html


PyWin32 follows the Windows API quite pedantically, except for GUI
where it wraps MFC. If you can read C and C++, the help file and
Microsoft's documentation is sufficient. I would say that despite of
being C or C++, the most important source for using PyWin32 is MSDN.
If Benoit is having trouble using PyWin32, I think he is having
trouble using the Windows API.
 
G

Gilles Ganault

If Benoit is having trouble using PyWin32, I think he is having
trouble using the Windows API.

I wouldn't blame him :) Besides, the point of writing Windows apps
directly in Python, ie. without relying on an extra GUI layer like
wxWidgets, is to be more productive than using C++.
 
K

kvamlnk

That's pretty unfair. If you know the Windows API, then the documentation is sufficient. If you need to learn the API, then it's unreasonable to expect Mark Hammond, et. al. to bundle the amount of material needed along with the software.

The book is an excellent introduction to the Windows API and explains in detail how pywin32 integrates Windows and Python. With the book in hand, much of the on-line Microsoft documentation becomes intelligible.

I understand that the Win32 has been said to be itself poorly
documented, so perhaps that the documentation that comes with the
modules is of similar quality is no coincidence. Maybe I'm still too
young in my programming to grasp the good of that documentation, but
for myself, it tells me next to nothing. Could anyone point me to
anything which may exist that does a better job of explaining the
extensions' use? I tried to take a look @ Microsoft's documentation,
but it was confusing.

There is Mark Hammond's book [1] about python-win32 though I haven't
used it and don't know if it contains anything that would be helpful
to you.
It is rather old now but some claim that is not important. [2]

Personally I consider Python-win32 to be docware -- software that is
sufficiently difficult to use with the included free documentation
that many people will just buy the $$$ documentation. Numpy is
another prominent example of docware. A misappropriation of the good-
will value of legitimate open source software.

[1]http://www.amazon.com/Python-Programming-Win32-Windows-Programmers/
dp/1565926218/ref=sr_1_1?ie=UTF8&s=books&qid=1198165983&sr=1-1
[2]
http://groups.google.com/group/comp...tion)+group:comp.lang.python#78b1390a6f6d75b2
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top