鉴于python不会自动把字符串转
换为数字或其他对象类型,如果我们需要使用诸如索引、加法等普通对象工具,就得这么做。...gid, size, atime, mtime, ctime) = os.stat(file)
print "last modified: %s" % time.ctime(mtime)
70.如何将字符串转换为...= {'a':1, 'b': 2}
>>> y = {'b':10, 'c': 11}
>>> z = x.update(y)
print x
我想要最终合并结果在z中,...x = {'a':1, 'b': 2}
>>> y = {'b':10, 'c': 11}
>>> z = dict(x.items() + y.items())
>>> z...{'a': 1, 'c': 11, 'b': 10}
如果在Python3中,会变得有些复杂
>>> z = dict(list(x.items()) + list(y.items