debug with parameters
简单来说就是配置下launch.json:
python:
#!/usr/bin/python3
import argparse
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('-u', '--user', dest='user', help='user, like 12.8')
parser.add_argument('-v', '--version', dest='version', help='data version number', default='0')
args = parser.parse_args()
print(args.user)
print(args.version)
launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "internalConsole",
"args": ["--user", "abc", "--version", "xyz"]
}
]
}
切换conda环境变量1
到settings里搜索interpret,改变defaultInterpreterPath
切换conda环境变量2
更换快捷键
搜索Keyboard Shortcuts,坑点在于Keyboard Shortcuts不在settings里,经常在code->Keyboard Shortcuts路径下
启动tensorboard
Shift+Command+P一起按住,点击下面的Launch TensorBoard
在explorer中定位文件
Shift+Command+P一起按住,输入reveal