使用vscode在写python的时候,运行python程序,会在文件夹中生成*.pyc
文件,或生成__pycache__
文件夹,影响操作:

在vscode中可以将其设置隐藏:
ctrl+shift+P打开显示所有命令,在输入框中输入settings回车,

进入User Settings页面搜索files.exclude

在右侧用户设置中添加 "**/__pycache__": true
,与之前用逗号隔开,覆盖默认值并保存
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/__pycache__": true
}

可以看到左侧的pycache目录被隐藏了。
如果要隐藏文件的话添加 "**/*.pyc": true
即可,*.pyc
是后缀名是pyc的文件,想隐藏其他类型文件,将后缀名替换即可。
网友评论