当前位置:   article > 正文

VSCode常用技巧_vscode parameter

vscode parameter

debug with parameters

简单来说就是配置下launch.json:

python:

  1. #!/usr/bin/python3
  2. import argparse
  3. parser = argparse.ArgumentParser(description='Process some integers.')
  4. parser.add_argument('-u', '--user', dest='user', help='user, like 12.8')
  5. parser.add_argument('-v', '--version', dest='version', help='data version number', default='0')
  6. args = parser.parse_args()
  7. print(args.user)
  8. print(args.version)

launch.json:

  1. {
  2. // Use IntelliSense to learn about possible attributes.
  3. // Hover to view descriptions of existing attributes.
  4. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  5. "version": "0.2.0",
  6. "configurations": [
  7. {
  8. "name": "Python: Current File",
  9. "type": "python",
  10. "request": "launch",
  11. "program": "${file}",
  12. "console": "internalConsole",
  13. "args": ["--user", "abc", "--version", "xyz"]
  14. }
  15. ]
  16. }

切换conda环境变量

到settings里搜索interpret,改变defaultInterpreterPath

更换快捷键

搜索Keyboard Shortcuts,坑点在于Keyboard Shortcuts不在settings里,经常在code->Keyboard Shortcuts路径下

启动tensorboard

Shift+Command+P一起按住,点击下面的Launch TensorBoard

在explorer中定位文件

Shift+Command+P一起按住,输入reveal

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/在线问答5/article/detail/770913
推荐阅读
相关标签
  

闽ICP备14008679号