pythonでrubyのstructがほしい時に・・・ 前提 Python 3.4.1 namedtuple namedtuple を使うらしい >>> from collections import namedtuple >>> f = ('Request', 'host sc size') >>> Request = namedtuple('Request', 'host sc size') >>> r = Request('10.60.111.10', 200, 456) >>> print (r) Request(host='10.60.111.10', sc=200, size=456) >>> print(r.size) 456