namedtuple example

This commit is contained in:
rasbt 2014-06-26 17:54:14 -04:00
parent 660ffd0a72
commit b792f8b03e

View File

@ -0,0 +1,5 @@
from collections import namedtuple
my_namedtuple = namedtuple('field_name', ['x', 'y', 'z', 'bla', 'blub'])
p = my_namedtuple(1, 2, 3, 4, 5)
print(p.x, p.y, p.z)