我正在根据 PEP8 格式化我的代码,但我有一个小问题;就是这样:
print ("DB Updated: " + datetime.datetime.fromtimestamp(int(stats_dict["db_update"])).strftime('%a %b %d %H:%M:%S %Y'))
如何将其分成 72-79 个字符的行?
最佳答案
timestamp = int(stats_dict["db_update"])
d = datetime.datetime.fromtimestamp(timestamp)
msg = "DB Updated: {}".format(d.strftime('%a %b %d %H:%M:%S %Y'))
print(msg)
关于python - 如何限制 Python 中复杂行的长度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13155445/