# vpdbz
为vscode生成Python调试配置生成器
## 安装
```shell
pip install vpdbz
```
## 命令行工具
使用`Python`命令行生成`VSCode`调试配置。
只需在`Python`命令前加上`vpdbz`,它就能自动生成`VSCode`的调试配置文件。它会正确解析环境变量和参数列表。
例如:
```shell
vpdbz CUDA_VISIBLE_DEVICES=1,2 python train.py --batch-size 16 --lr 1e-4
```
它会在`.vscode/launch.json`中生成调试配置。然后你可以通过点击相应的按钮来调试你的`Python`文件。
```shell
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: python train.py --batch-size 16 --lr 1e-4",
"type": "python",
"request": "launch",
"program": "train.py",
"env": {
"CUDA_VISIBLE_DEVICES": "1,2"
},
"console": "integratedTerminal",
"args": [
"--batch-size",
"16",
"--lr",
"1e-4"
],
"cwd": "/home/xxx/demo_project",
"justMyCode": false,
"variablePresentation": {
"all": "hide",
"protected": "inline"
}
}
]
}
```
注意:vpdbz命令必须在vscode项目的根文件夹中执行。
## 更新日志
2024.07.17
1. 为vpdbz自动安装依赖项。
2. 处理环境变量。
3. 隐藏特殊变量和函数变量。
4. 调试所有Python文件。
Raw data
{
"_id": null,
"home_page": "https://github.com/zhangkaifang/vpdbz",
"name": "vpdbz",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "vscode, debug, launch.json, vpdbz",
"author": "kf.zhang",
"author_email": "kf.zhang@shunwang.com",
"download_url": "https://files.pythonhosted.org/packages/4c/8c/fbba8efc1daea055d2364300fac8aac95f0caa3eb3716c1ad4de0691dff5/vpdbz-0.5.0.tar.gz",
"platform": null,
"description": "# vpdbz\n\n\u4e3avscode\u751f\u6210Python\u8c03\u8bd5\u914d\u7f6e\u751f\u6210\u5668\n\n## \u5b89\u88c5\n```shell\npip install vpdbz\n```\n\n## \u547d\u4ee4\u884c\u5de5\u5177\n\n\u4f7f\u7528`Python`\u547d\u4ee4\u884c\u751f\u6210`VSCode`\u8c03\u8bd5\u914d\u7f6e\u3002\n\n\u53ea\u9700\u5728`Python`\u547d\u4ee4\u524d\u52a0\u4e0a`vpdbz`\uff0c\u5b83\u5c31\u80fd\u81ea\u52a8\u751f\u6210`VSCode`\u7684\u8c03\u8bd5\u914d\u7f6e\u6587\u4ef6\u3002\u5b83\u4f1a\u6b63\u786e\u89e3\u6790\u73af\u5883\u53d8\u91cf\u548c\u53c2\u6570\u5217\u8868\u3002\n\n\u4f8b\u5982\uff1a\n\n```shell\nvpdbz CUDA_VISIBLE_DEVICES=1,2 python train.py --batch-size 16 --lr 1e-4\n```\n\n\u5b83\u4f1a\u5728`.vscode/launch.json`\u4e2d\u751f\u6210\u8c03\u8bd5\u914d\u7f6e\u3002\u7136\u540e\u4f60\u53ef\u4ee5\u901a\u8fc7\u70b9\u51fb\u76f8\u5e94\u7684\u6309\u94ae\u6765\u8c03\u8bd5\u4f60\u7684`Python`\u6587\u4ef6\u3002\n\n```shell\n\n{\n \"version\": \"0.2.0\",\n \"configurations\": [\n {\n \"name\": \"Python: python train.py --batch-size 16 --lr 1e-4\",\n \"type\": \"python\",\n \"request\": \"launch\",\n \"program\": \"train.py\",\n \"env\": {\n \"CUDA_VISIBLE_DEVICES\": \"1,2\"\n },\n \"console\": \"integratedTerminal\",\n \"args\": [\n \"--batch-size\",\n \"16\",\n \"--lr\",\n \"1e-4\"\n ],\n \"cwd\": \"/home/xxx/demo_project\",\n \"justMyCode\": false,\n \"variablePresentation\": {\n \"all\": \"hide\",\n \"protected\": \"inline\"\n }\n }\n ]\n}\n\n```\n\u6ce8\u610f\uff1avpdbz\u547d\u4ee4\u5fc5\u987b\u5728vscode\u9879\u76ee\u7684\u6839\u6587\u4ef6\u5939\u4e2d\u6267\u884c\u3002\n\n\n## \u66f4\u65b0\u65e5\u5fd7\n\n2024.07.17\n1. \u4e3avpdbz\u81ea\u52a8\u5b89\u88c5\u4f9d\u8d56\u9879\u3002\n2. \u5904\u7406\u73af\u5883\u53d8\u91cf\u3002\n3. \u9690\u85cf\u7279\u6b8a\u53d8\u91cf\u548c\u51fd\u6570\u53d8\u91cf\u3002\n4. \u8c03\u8bd5\u6240\u6709Python\u6587\u4ef6\u3002",
"bugtrack_url": null,
"license": null,
"summary": "Python debug configuration generator for vscode",
"version": "0.5.0",
"project_urls": {
"Homepage": "https://github.com/zhangkaifang/vpdbz",
"Repository": "https://github.com/zhangkaifang/vpdbz"
},
"split_keywords": [
"vscode",
" debug",
" launch.json",
" vpdbz"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "dc390f735aa12b7153d1973afa4466f4387cdd256ee7f8738a15a091cee2ba9d",
"md5": "9a51c6f3e211866cd24767a2c5e19e2e",
"sha256": "a6f689d47ef7ddfe00e5d90b52e0e01cb628f09f121be6b5909687aee3dda792"
},
"downloads": -1,
"filename": "vpdbz-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9a51c6f3e211866cd24767a2c5e19e2e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 3239,
"upload_time": "2024-07-31T02:08:35",
"upload_time_iso_8601": "2024-07-31T02:08:35.994662Z",
"url": "https://files.pythonhosted.org/packages/dc/39/0f735aa12b7153d1973afa4466f4387cdd256ee7f8738a15a091cee2ba9d/vpdbz-0.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4c8cfbba8efc1daea055d2364300fac8aac95f0caa3eb3716c1ad4de0691dff5",
"md5": "a8250f8962d03ed50d5eb3784e0a07af",
"sha256": "192d8bd7580ea406083b89f6463c55b9c9cd3578ab55f11611086b2a82ebdd34"
},
"downloads": -1,
"filename": "vpdbz-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "a8250f8962d03ed50d5eb3784e0a07af",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 2466,
"upload_time": "2024-07-31T02:08:37",
"upload_time_iso_8601": "2024-07-31T02:08:37.475323Z",
"url": "https://files.pythonhosted.org/packages/4c/8c/fbba8efc1daea055d2364300fac8aac95f0caa3eb3716c1ad4de0691dff5/vpdbz-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-31 02:08:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zhangkaifang",
"github_project": "vpdbz",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "vpdbz"
}