En Consola:
:~$ sudo apt-get install python-parallel:~$ sudo rmmod lp:~$ sudo modprobe ppdev:~$ python Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import parallel >>> p = parallel.Parallel() >>> p.setData(0x55)
En programa:
#!/usr/bin/env pythonimport parallel if __name__ == "__main__": pyp = parallel.Parallel() pyp.setData(0x01) # Valor en d0-d7, pines 2-9
Class referenfe pyparallel 0.2-6