0

: 1495 : 2020-02-11 11:55:00 (1, 0)

Here is my sample result but then when I'm trying to split it gives me error

Process terminate : 'Attendance' object has no attribute 'split'

In the documentation it says print (attendance) # Attendance object

How to access it?

jacob Denis
  • 51
  • 11

3 Answers3

1

Convert the attendance object into a string and split it.

str(attendance).split()

After splitting you can access the user ID and use it where ever you want.

Dan Niles
  • 11
  • 1
0

found the solution

i check in the github repository of pyzk and look for the attendance class and found all the object being return by the live_capture thank you :)

jacob Denis
  • 51
  • 11
0

It's an object of class Attendance. The split() is a method of string. So you can't directly split() an object. Dan is right, to split an object, first, you have to convert it to a string.

str(obj).split()

Although, you don't need to split this object to get the user id. All you have to do is, use accessor. e.g

user_id = attendance_obj.user_id
Muhammad Afzaal
  • 308
  • 4
  • 10