Categories
- Blog (104)
- Lua (13)
- Miscellaneous (48)
- Photos (6)
- Programming (33)
- Python (15)
- Sample (3)
- Web Design (3)
- Writing (2)
- Portfolio (40)
- Snippets (28)
- Blog (104)
Tag Archives: linked list
Linked Lists via ctypes in Python
from ctypes import *
class linknode(Structure):
pass
linknode._fields_ = [
("nextNode", POINTER(linknode)),
("intData", c_int),
]
class linked_list():
head_node = None
def add(self, int_data):
node_to_add = linknode(intData = c_int(int_data))
if (self.head_node == None):
self.head_node = node_to_add
else:
traverse_node
…
Posted in Programming, Python, Snippets
Tagged ctypes, linked list, pointers, Python, structure
Leave a comment