How can I use printer port in python?...

Peter Hansen peter at engcorp.com
Tue Dec 12 23:49:54 EST 2000


Seo ji won wrote:
> 
> "Peter Hansen" <peter at engcorp.com> wrote:
> > We could assume you mean a parallel port, and that you are on Windows,
> > and that you don't actually plan to talk to a printer here, but then
> > again we could be wrong.  Help us out!
>
> Oh, I'm using Win2k(server..) and using python 2.0,
> and want to use parallel port...
> 
> I looked at those archives which you suggested, but there's no direct
> answer..

Quite true, but it gave us the needed shared reference for a discussion.
:)

> -- or  I  don't know if its answer :)
> 
> Do I have to use c code to use parallel port on windows?..
> 
> If I have to use c, just give me brief sample for it... ;-)
> 
> if not, tell me how can I deal with parallel port with python...

Unfortunately, you haven't quite answered the question fully: do you
plan to talk to a printer or some other kind of device where you want
directly to control the pins in the parallel port?  

If the latter, what kind of control do you need?  Just the eight data
pins?  Any of the handshaking pins?  Are you transferring data in and
out (bidirectional) or just controlling some device without feedback? 
All these things are rather relevant in providing a correct answer to
the question.

In any case, your use of W2K is probably a big problem if you want the
latter.  As with NT (and I'm assuming here, since I've never used W2K
and hope not to), you cannot directly control the hardware.  You would
have to go through the operating system's API or use a driver and wrap
that with appropriate code (quite possibly with C code, depending on
what you really want here).  All these areas quickly go beyond any
experience I've had, so I doubt I can "help" further...



More information about the Python-list mailing list