1,关于tab键与4个空格:
由于不同平台间,tab键值设置有所区别,据相关介绍,官方在缩进方面推荐使用4个空格。方便起见,可设置tab自动转换为4个空格。
- 1.1在pycharm中:
通过file-->settings-->editor-->code style-->python中进行设置
table size :4
indent:4
continuation indent:8
2,pycharm 设置新建文件自动填充内容:
File-->settings-->editor-->File and code templates 根据具体需要,添加/更改自动填充内容
- File-->settings-->editor-->File and code templates Python Script
- 配置举例
-
#!/usr/bin/env python
#-*- coding:utf-8 -*-
-
- 配置举例
- File-->settings-->editor-->File and code templates HTML File
- 配置举例
-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Title</title>
</head>
<body>
</body>
</html>
-
- 配置举例
3,关于pycharm侧边栏的显示
如果要pycharm在侧边栏中,显示文件中包含的类、函数等信息,在侧边栏的设置选项中,点击激活 “show members”
4,新建process设置问题
当pycharm出现新建项目后,在左侧的项目栏中不显示项目目录时,File-->settings-->project stucture--> 在sources中,通过add content root 添加项目所在的路径,并设置为 Sourses即能显示。
5,pycharm中起多进程的问题
在pycharm中,如果是 2018.3之后版本 想同时运行同一个程序(启用多进程)的时候,会报出 not allowed to run in parallel 的提示,并且不能开启。解决方法,Run -> Edit Configurations -> Allow parallel run