在解释器中,您可以只写一个对象的名称,例如在这样解释提示列表a = [1, 2, 3, u"hellö"]
:Python解释器中的>>> >>> some_object和print >>> some_object有什么不同?
>>> a
[1, 2, 3, u'hell\xf6']
,或者你可以这样做:
>>> print a
[1, 2, 3, u'hell\xf6']
这似乎等效名单。目前我正在使用hdf5来管理一些数据,并且我意识到上述两种方法之间存在差异。鉴于:
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")
的
print h5file
输出从
>>> h5file
不同,所以我想知道,如果有人可以解释在这两种情况下Python的行为差异?
这是记录在哪里?我找不到它。 – jtbandes
@jtbandes不知道在哪里,但你可以自己测试一下。 PS:有人可以请求格式化内联代码吗?它不适用于移动设备。谢谢 ! –
当然,我可以测试它,这不是我问我:) – jtbandes