1
저는 beginner.After libUSB, Python 및 PyUSB 패키지를 설치하고 내 ACR122U가 컴퓨터에 연결되어 있습니다. 다음과 같이 코드를 작성하고 싶습니다.파이썬에 대해 nfcpy "사용할 수있는 nfc 리더를 찾을 수 없습니다"
난을 해결하는 방법을 잘 모릅니다Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\tools\python\nfc\clf.py", line 58, in __init__
raise LookupError("couldn't find any usable nfc reader")
LookupError: couldn't find any usable nfc reader
: 나는 라인에 도착하면
import os
import sys
import time
sys.path.insert(1, os.path.split(sys.path[0])[0])
import nfc
import nfc.ndef
def main():
clf = nfc.ContactlessFrontend()
print "Please touch a tag to send a hello to the world"
while True:
tag = clf.poll()
if tag and tag.ndef:
break
text_en = nfc.ndef.TextRecord(language="en", text="Hello World")
text_de = nfc.ndef.TextRecord(language="de", text="Hallo Welt")
text_fr = nfc.ndef.TextRecord(language="fr", text="Bonjour tout le monde")
message = nfc.ndef.Message([text_en, text_de, text_fr])
tag.ndef.message = str(message)
print "Remove this tag"
while tag.is_present:
time.sleep(1)
print "Now touch it again to receive a hello from the world"
while True:
tag = clf.poll()
if tag and tag.ndef:
break
message = nfc.ndef.Message(tag.ndef.message)
for record in message:
if record.type == "urn:nfc:wkt:T":
text = nfc.ndef.TextRecord(record)
print text.language + ": " + text.text
if __name__ == '__main__':
main()
는
clf= nfc.ContactlessFrontend()"
다음 질문을했다 아무도 나 좀 도와 줄 수있어? "Petesh는"출력에
python -d helloworld.py
을 실행하여 자신의 의견에 말했듯이
파이썬 로그 레벨을 디버깅하여 다시 실행 해 보셨습니까? 문제가 무엇인지 결정하는 데 도움이 될 수있는 모듈에서 방출되는 많은 로그 메시지가 있습니다. – Petesh