栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

vscode新手到高级

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

vscode新手到高级

一、配色二、远程连接服务器1.下载插件remoteSSH2.配置config文件 三、Debuglaunch.json带有 -m 参数在命令行运行 而后在VSCode中 四、自动配置环境

一、配色

文件-首选项-颜色主题-浅色/默认浅色

二、远程连接服务器 1.下载插件remoteSSH 2.配置config文件

.ssh/config

Host ldif
 HostName 10.7.28.47
 User root
 Port 2022
三、Debug launch.json
{
 // 使用 IntelliSense 了解相关属性。 
 // 悬停以查看现有属性的描述。
 // 欲了解更多信息 请访问: https://go.microsoft.com/fwlink/?linkid 830387
 version : 0.2.0 ,
 configurations : [
 python : /root/anaconda3/envs/CAD/bin/python3.7 ,
 name : json2mesh ,
 type : python ,
 request : launch ,
 program : /root/DeepCAD/dataset/json2mesh.py ,
 console : integratedTerminal ,
 env : {
 CUDA_VISIBLE_DEVICES : 2,3 
 args : [
 --only_test 

https://blog.csdn.net/weixin_39278265/article/details/107705492

带有 -m 参数

我在命令行运行的是python3 -m sosed.run -i input_examples/input.txt -o
output/closure/ 但是在VSCode中的普通调试 会报模块找不到的问题 原因是普通调试不会带-m参数 所以有些路径就会找不到 。

在命令行运行
# 先按照这个module
python3 -m pip install debugpy 
# 在命令行运行 
python3 -m debugpy --listen 5678 --wait-for-client -m sosed.run -i input_examples/input.txt -o output/closure/
而后在VSCode中

点击 上方菜单栏- debug- Open Configurations 修改内容为如下

{
 // 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: Attach ,
 type : python ,
 request : attach ,
 connect : {
 host : localhost ,
 port : 5678
四、自动配置环境

修改/root/.bashrc文件
最后一行添加 source activate name

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/267843.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号