惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
NISL@THU
NISL@THU
E
Exploit-DB.com RSS Feed
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
K
Kaspersky official blog
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
S
Schneier on Security
G
GRAHAM CLULEY
The Hacker News
The Hacker News
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
T
Tor Project blog
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
爱范儿
爱范儿
P
Privacy International News Feed
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
S
Securelist
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
Google Online Security Blog
Google Online Security Blog
美团技术团队
F
Fortinet All Blogs
小众软件
小众软件
Recorded Future
Recorded Future
V
Visual Studio Blog
B
Blog RSS Feed
H
Help Net Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
Latest news
Latest news
Spread Privacy
Spread Privacy
H
Heimdal Security Blog

博客园 - onekey

MPU9250九轴陀螺仪--读接口数据 MPU9250九轴陀螺仪--连接MPU9250 Elasticsearch -- 索引管理 centos 7下rabbitmq安装(转) CentOS下Redis的安装(转) CentOS7.5 安装MySQL8 tar Ntrip协议简介(转) 路径规划(3)--搭建Ntrip环境:NtripServer,NtripClient and NtripCaster 路径规划(2)--设置基站和移动站 路径规划(1)--连接GPS接收端 在CentOS 7上安装Nginx elasticsearch -- Logstash实现mysql同步数据到elasticsearch elasticsearch -- 安装 elasticsearch -- kibana安装配置 Elasticsearch -- Head插件安装 在Win10 Anaconda中安装Tensorflow TensorFlow官方文档中文版 myeclipse编译、输出 win7 64位下使用oracle ado.net entity framework
环境搭建--使用pytharm远程调试树莓派
onekey · 2019-01-22 · via 博客园 - onekey

对于Linux和文本编辑器不那么熟悉的小伙伴来说,直接在树莓派中写程序可谓是痛苦万分。本文将介绍如何使用PyCharm远程调试树莓派,并同步当前python文件到树莓派中。

配置环境

首先要在个人电脑中装上PyCharm,注意,一定要是专业版的。

树莓派需已经设置好联网和SSH,并与电脑处于同一局域网下。

本文所有代码均为python3.x下可用,python2.x略有不同。

写测试代码

首先在个人电脑中建立一个工程,写一个hello程序(最最经典的程序),并在本机上测试运行。代码如下:

    print('hello raspberry')

配置PyCharm环境

使用SSH连接树莓派

进入之前新建的python文件下,依次打开File -> Settings -> Project Interpreter,点旁边的小齿轮,选择Add Romote,进入环境配置。

选择SSH Credentials,Host中填写树莓派的IP地址,User name 和 Password默认为pi 和 raspberry,注意,选择Python interpreter path时,如果想使用python3版本,请务必按照截图输入,若为python2版本,则去掉后面的版本号即可。最后点击ok完成设置。

配置上传路径

依次打开Tool -> Deployment -> Configure,在打开的页面中Type选择SFTP协议,然后继续填写树莓派的IP地址以及用户名和密码,其余默认。

点开Mapping选项卡,配置工程目录,这里主要是设置Deployment path on server,该选项会将电脑上的文件上传到树莓派的对应位置,一般建议目录为/Desktop/py,其他可以默认,点击ok完成配置。

上传工程

依次点击Tool -> Upload to xxx,点击调试按钮自动安装调试插件,安装完成后自动开始调试。

这时候你就可以看见你的工程已经自动上传到树莓派中。

运行程序

直接运行程序