Figuring out the Printer port base address

Chris Liechti cliechti at gmx.net
Sun Dec 29 10:40:49 EST 2002


akineko at pacbell.net (Aki Niimura) wrote in
news:b714b8de.0212282245.b973a43 at posting.google.com: 

> Hi everyone,
> 
> I'm writing a Python program which accesses the PC printer port
> directly. Thanks to PortIO package from Scientific Software Tools, Inc
> (www.driverlinx.com) and 'calldll' and 'windll' from Sam Rushing, I
> can access hardware I/O addresses directly from my Python program.

i have my own solution here... it runs on linux and win32
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyserial/pyparallel/
 
> However, I couldn't find a way to determine the Printer port base
> address. LPT1 is usually assigned to 0x378 - 0x37A but not always.
> In fact, the LPT1 in my laptop is assigned 0x3BC - 0x3be.
> 
> I found a posting mentioning the following code fragment:
> int GetLPTAddr() {
>     return(_peek(0x08,0x40) | _peek(0x09, 0x40) << 8);
> }
> 
> But I couldn't find any package which allows reading memory (BIOS
> area) from Python.

i use the giveio driver which i use in my package, it allows to do that.
you can get giveio seprately here 
http://sourceforge.net/project/showfiles.php?group_id=42303&release_id=1197
87 where i wrapped it with an installer. (but then you need to do some C)

chris

-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list