我无法在PyCharm中创建有用/干净的代码样式,在我执行代码自动格式化时不会破坏我的代码。
一般来说,我希望我的字符串看起来像这样:
message = ("There are " + str(avd_instances) + " AVD instances about to be created according to set, "
"but there were only " + str(requested_ports_to_use_num) + " ports ")
或者那样:
raise MyException(
TAG,
"There are " + str(avd_instances) + " AVD instances about to be created according to set, "
"but there were only " + str(requested_ports_to_use_num) + " ports "
)
但我得到的是这样的:
或类似的东西:
这简直太丑了,而且有一种混乱。还有更糟糕的情况。
如果您有其他建议,我如何格式化我的代码以使其与PyCharm"兼容?我会很高兴听到。