Seite 1 von 1

pyparallel

Verfasst: Donnerstag 4. Mai 2006, 17:36
von blan
erstmal hallo - bin neu hier!

also ich hab ma kurz versucht pyserial und pyparallel zu benutzen, aber ich komm einfach net an dem problem vorbei:

Code: Alles auswählen

#!/usr/bin/env python

import parallel

p = parallel.Parallel()
hier kommt immer der fehler

Code: Alles auswählen

Traceback (most recent call last):
  File "parallel.py", line 4, in ?
    import parallel
  File "/home/marc/python/parallel.py", line 6, in ?
    p = parallel.Parallel()
AttributeError: 'module' object has no attribute 'Parallel'
mfg blan

Verfasst: Donnerstag 4. Mai 2006, 18:16
von rayo
Hi

Du darfst dein Modul nicht gleich nennen wie das von pyParallel.

Mit import parallel importierst du jetzt dein eigenes Modul.

Gruss

Verfasst: Donnerstag 4. Mai 2006, 18:27
von blan
ahh :) danke - hab jetzt aber folgendes problem

Code: Alles auswählen

Traceback (most recent call last):
  File "pa.py", line 6, in ?
    p = parallel.Parallel()
  File "/usr/lib/python2.3/site-packages/parallel/parallelppdev.py", line 186, in __init__
    self._fd = os.open(self.device, os.O_RDWR)
OSError: [Errno 2] No such file or directory: '/dev/parport0'
Exception exceptions.AttributeError: "Parallel instance has no attribute '_fd'" in <bound method Parallel._ _del__ of <parallel.parallelppdev.Parallel instance at 0x401de3ec>> ignored
hiest die normale geräte-datei wirklich parport0 - die gibts bei mir nähmlich net... parallelport ist aber aktiv im kernel

edit: hat sich erledigt - kernel-modul war nicht aktiv

mfg blan