朋友说程序写大了远程debug非常麻烦,这里说一下pycharm连接服务器远程debug,也可以使用vscode不过vscode对python的支持不如pycharm。
首先,创建一个ssh pycharm tools-Deployment-configuration
选择sftp然后依次填入地址 根目录以及账号密码 根目录是为了每次进入文件方便


因为服务器文件名字有关项目这里全部打了马赛克见谅!
选择你要debug在服务器上的文件夹比如我这个爬虫jobs
然后在本地建立一个文件夹

然后进入刚刚的路径点击mappings

设置mapping

这时我们需要同步服务器和本地文件夹



按着箭头点击之后本地和服务器上都有文件了
之后需要把自动上传点开

然后看到服务器的文件已经成为绿色

之后设置一下传参


run debug
网友评论