诸如下面这种的,数据一长格式排版就不好看了,不知道如何排版是好?

result = Animal.filter(name='dog', sex='female', age='2', color='yellow').limit(100).order(born)


江户川乱折腾
浏览 195回答 2
2回答

慕哥6287543

Yes:# Aligned with opening delimiterfoo = long_function_name(var_one, var_two,                          var_three, var_four)# More indentation included to distinguish this from the rest.def long_function_name(         var_one, var_two, var_three,         var_four):    print(var_one)No:# Arguments on first line forbidden when not using vertical alignmentfoo = long_function_name(var_one, var_two,     var_three, var_four)# Further indentation required as indentation is not distinguishabledef long_function_name(     var_one, var_two, var_three,     var_four):    print(var_one)Optional:# Extra indentation is not necessary.foo = long_function_name(   var_one, var_two,   var_three, var_four)

万千封印

result = Animal.filter(        name='dog',        sex='female',        age='2',        color='yellow'     ).limit(100).order(born)
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python