In the interpreter you can just write the name of an object e.g. a list a = [1, 2, 3, u"hell?"]
at the interpreter prompt like this:
>>> a
[1, 2, 3, u'hellxf6']
or you can do:
>>> print a
[1, 2, 3, u'hellxf6']
which seems equivalent for lists. At the moment I am working with hdf5 to manage some data and I realized that there is a difference between the two methods mentioned above. Given:
with tables.openFile("tutorial.h5", mode = "w", title = "Some Title") as h5file:
group = h5file.createGroup("/", 'node', 'Node information')
tables.table = h5file.createTable(group, 'readout', Node, "Readout example")
The output of
print h5file
differs from
>>> h5file
So I was wondering if someone could explain Python's behavioral differences in these two cases?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…