parallel port access?

Suchandra Thapa ssthapa at harper.uchicago.edu
Thu Dec 7 03:26:35 EST 2000


jkndeja at my-deja.com <jkndeja at my-deja.com> wrote:
>It is not advisable to be able to do this on a platform such as the PC,
>since you can crash your machine etc. very easily like this. Depending
>on the Operating System you are running, you might not even be allowed
>to do this even in Assembly language - it involves a change in
>operating system privileges which you may not be allowed to do.

    You can directly read and write ports on windows 95/98/me(?) but
you need to create a vxd to access ports on NT and 2000.  From my experience
it is relatively safely to directly modify the parallel port as long as
nothing else is trying to access it.  If you have control over the workstation,
you can insure the latter condition by not printing and/or only running 
one program that interfaces with the parallel port.  
    This approach has worked well in trying to control some 
electronics (a laser and some PMTs to be exact) over the parallel port.
The parallel port faq has some code samples and some pointers.  There is
also a DLL floating around but that is only a wrapper around inport and
outport calls.  You can probably use SWIG to get a python interface for
that.

-- 
------------------------------------------------------------------
			    |
Suchandra Thapa             | "There are only two kinds of math books. 
s-thapaNO at SPAMuchicago.edu  | Those you cannot read beyond the first 
			    | sentence, and those you cannot read 
			    | beyond the first page."
			    |                       -C.N. Yang
------------------------------------------------------------------



More information about the Python-list mailing list