pycharm中默认的代码对齐快捷键为ctrl+alt+L,但是会和其他软件的快捷键冲突,更改相应的快捷键设置为: File->settings->Keymap->右侧的Main Menu->code->Reformat Code image.png