本示例使用的發卡器:https://item.taobao.com/item.htm?spm=a21dvs.23580594.0.0.52de2c1bV0E4YV&ft=t&id=615391857885
import sys
import struct # struct的pack函數把任意數據類型變成字符串
import ctypes # 調用DLL動態庫要有這個引用if sys.platform == 'linux' or sys.platform == 'mac':# Linux加載當前目錄下的so庫dllfile = sys.path[0] + '/libOURMIFARE.so'Objdll = ctypes.cdll.LoadLibrary(dllfile)else:# windows系統加載當前目錄下的DLL庫dllfile = sys.path[0] + '\OUR_MIFARE.dll'Objdll = ctypes.windll.LoadLibrary(dllfile)status = Objdll.forumtype2_write_ndeftag(myctrlword, mypiccserial, oldpicckey) % 256
? ? ? ??