1, 设置python路径 2,运行py文件 https://www.jetbrains.com/help/pycharm/2016.1/creating-and-running-your-first-python-project.html#d50296e226 3, 格式化代码 From the main menu, select Code | Reformat Code or press Ctrl+Alt+L.