本示例使用的发卡器: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