Skip to content
Advertisement

Accessing a structure element in Python

I’m having trouble accessing a structure element. Notice that I have read something into the structure using sscanf (to simulate my actual routine) but Python does not seem to realize that. So I added a statement to assign a value, then Python realizes there is something there. This only happens when I’m reading into a strcuture … as I have read into a c_ulong and that works just fine.

JavaScript

Advertisement

Answer

You are printing the class variable not the instance variable (note the case):

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement