update sample scripts
This commit is contained in:
parent
901f29f556
commit
1a765d6165
@ -6,7 +6,7 @@ CWD = os.path.dirname(os.path.realpath(__file__))
|
|||||||
ROOT_DIR = os.path.dirname(CWD)
|
ROOT_DIR = os.path.dirname(CWD)
|
||||||
sys.path.append(ROOT_DIR)
|
sys.path.append(ROOT_DIR)
|
||||||
|
|
||||||
from zk import ZK, const
|
from zk import ZK
|
||||||
|
|
||||||
|
|
||||||
conn = None
|
conn = None
|
||||||
|
@ -6,7 +6,7 @@ CWD = os.path.dirname(os.path.realpath(__file__))
|
|||||||
ROOT_DIR = os.path.dirname(CWD)
|
ROOT_DIR = os.path.dirname(CWD)
|
||||||
sys.path.append(ROOT_DIR)
|
sys.path.append(ROOT_DIR)
|
||||||
|
|
||||||
from zk import ZK, const
|
from zk import ZK
|
||||||
|
|
||||||
|
|
||||||
conn = None
|
conn = None
|
||||||
|
25
example/live_capture.py
Normal file
25
example/live_capture.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
CWD = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
ROOT_DIR = os.path.dirname(CWD)
|
||||||
|
sys.path.append(ROOT_DIR)
|
||||||
|
|
||||||
|
from zk import ZK
|
||||||
|
|
||||||
|
|
||||||
|
conn = None
|
||||||
|
zk = ZK('192.168.2.201', port=4370)
|
||||||
|
try:
|
||||||
|
conn = zk.connect()
|
||||||
|
for attendance in conn.live_capture():
|
||||||
|
if attendance is None:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
print (attendance)
|
||||||
|
except Exception as e:
|
||||||
|
print ("Process terminate : {}".format(e))
|
||||||
|
finally:
|
||||||
|
if conn:
|
||||||
|
conn.disconnect()
|
@ -6,7 +6,7 @@ CWD = os.path.dirname(os.path.realpath(__file__))
|
|||||||
ROOT_DIR = os.path.dirname(CWD)
|
ROOT_DIR = os.path.dirname(CWD)
|
||||||
sys.path.append(ROOT_DIR)
|
sys.path.append(ROOT_DIR)
|
||||||
|
|
||||||
from zk import ZK, const
|
from zk import ZK
|
||||||
|
|
||||||
|
|
||||||
conn = None
|
conn = None
|
||||||
|
@ -6,7 +6,7 @@ CWD = os.path.dirname(os.path.realpath(__file__))
|
|||||||
ROOT_DIR = os.path.dirname(CWD)
|
ROOT_DIR = os.path.dirname(CWD)
|
||||||
sys.path.append(ROOT_DIR)
|
sys.path.append(ROOT_DIR)
|
||||||
|
|
||||||
from zk import ZK, const
|
from zk import ZK
|
||||||
|
|
||||||
|
|
||||||
conn = None
|
conn = None
|
||||||
|
@ -7,7 +7,7 @@ CWD = os.path.dirname(os.path.realpath(__file__))
|
|||||||
ROOT_DIR = os.path.dirname(CWD)
|
ROOT_DIR = os.path.dirname(CWD)
|
||||||
sys.path.append(ROOT_DIR)
|
sys.path.append(ROOT_DIR)
|
||||||
|
|
||||||
from zk import ZK, const
|
from zk import ZK
|
||||||
|
|
||||||
|
|
||||||
conn = None
|
conn = None
|
||||||
|
@ -7,7 +7,7 @@ CWD = os.path.dirname(os.path.realpath(__file__))
|
|||||||
ROOT_DIR = os.path.dirname(CWD)
|
ROOT_DIR = os.path.dirname(CWD)
|
||||||
sys.path.append(ROOT_DIR)
|
sys.path.append(ROOT_DIR)
|
||||||
|
|
||||||
from zk import ZK, const
|
from zk import ZK
|
||||||
|
|
||||||
|
|
||||||
conn = None
|
conn = None
|
||||||
|
Loading…
Reference in New Issue
Block a user