有关于使用Atom进行Python开发的网上资料比较少,最近发现使用Atom结合Hydrogen插件进行Python开发,尤其是数据挖掘相关的工作,整体体验要好于Vscode,Vscode虽然说也有连接Jupyter的工具,但是交互式的开发Hydrogen体验更好。

这里放了个动图来展示一下Hydrogen的强大

插件安装

Python

  • Hydrogen
  • atom-ide-ui
  • ide-python

这里要注意,本地的pip需要 安装 python-language-server[all],在ide-python的readme中有详细说明

远程连接

  • Remote FTP

美化

  • simplified-chinese-menu(汉化补丁)

  • file-icons(文件夹图标)

  • bracket-colorizer(彩虹括号,找了好久,确定就是必须配合暗色主题)

  • atom-bracket-highlight(括号高亮)

  • atom-clock(加个时钟在右下角)

  • highlight-selected(高亮选择)

  • minimap(类似sublime的右侧map栏)

  • minimap-highlight-selected(选择代码后,map上也高亮,方便定位代码)

插件配置

Remote FTP

这里先讲一下我的需求,我是需要利用其连接公司服务器上的内容,但是公司服务器是需要跳板机的,所以我需要通过跳板机才能访问,因此配置上会有些复杂

{
"protocol": "sftp",
"host": "跳板机域名", // string - Hostname or IP address of the server. Default: 'localhost'
"port": 跳板机端口, // integer - Port number of the server. Default: 22
"user": "用户名", // string - Username for authentication. Default: (none)
"pass": "如果用密钥这里就不用填", // string - Password for password-based user authentication. Default: (none)
"promptForPass": false, // boolean - Set to true for enable password/passphrase dialog. This will prevent from using cleartext password/passphrase in this config. Default: false
"remote": "实际的服务器目录,例如:/服务器域名/用户名/目录", // try to use absolute paths starting with /
"agent": "", // string - Path to ssh-agent's UNIX socket for ssh-agent-based user authentication. Linux/Mac users can set "env" as a value to use env SSH_AUTH_SOCK variable. Windows users: set to 'pageant' for authenticating with Pageant or (actual) path to a cygwin "UNIX socket." Default: (none)
"privatekey": "本地私钥path", // string - Absolute path to the private key file (in OpenSSH format). Default: (none)
"passphrase": "", // string - For an encrypted private key, this is the passphrase used to decrypt it. Default: (none)
"hosthash": "", // string - 'md5' or 'sha1'. The host's key is hashed using this method and passed to the hostVerifier function. Default: (none)
"ignorehost": true,
"connTimeout": 10000, // integer - How long (in milliseconds) to wait for the SSH handshake to complete. Default: 10000
"keepalive": 10000, // integer - How often (in milliseconds) to send SSH-level keepalive packets to the server (in a similar way as OpenSSH's ServerAliveInterval config option). Set to 0 to disable. Default: 10000
"keyboardInteractive": 如果要用动态令牌,这里就要填true, // boolean - Set to true for enable verifyCode dialog. Keyboard interaction authentication mechanism. For example using Google Authentication (Multi factor)
"keyboardInteractiveForPass": false, // boolean - Set to true for enable keyboard interaction and use pass options for password. No open dialog.
"remoteCommand": "",
"remoteShell": "",
"watch":[],
"watchTimeout":500, // integer - The duration ( in milliseconds ) from when the file was last changed for the upload to begin.
}

ide-python

需要配置一下Python Executable

填写你的python路径,比如使用的是conda虚拟环境,就这样写

/xxx/anaconda3/envs/xxx/bin/python

Hydrogen

连接本地Kernel

首先需要在上面填写的路径下的python环境中安装ipykernel

python -m ipykernel install --user --name py37

然后用atom打开一个py文件,输入

# %%
print('hello atom') # %%
print('每一个# %%代表一个新的cell')

然后再第2行末尾按ctrl+enter就会自动弹出来让你选择环境的弹窗,选择刚刚新建的环境即可

然后在Hydrogen里面通过使用# %%来分割每一个cell,在Mac中使用option+shift+enter组合键来实现运行当前整个ceil,使用command+enter实现运行当前行,使用shift+enter实现运行当前行并跳转下一行,具体可参考官方文档

连接远程Kernel

连接远程的Jupyter只需要配置一下Hydrogen设置里面的Kernel Gateways,填上如下内容即可

[{"name": "Remote server",
"options": {
"baseUrl": "jupyter url",
"token": "jupyter token"
}
}]

然后点击Connect to Remote Kernel即可

更好地使用Atom支持基于Jupyter的Python开发的更多相关文章

  1. 配置基于Vim的Python开发环境

    配置基于Vim的Python开发环境插件 Vundle YouCompleteMe NERDTree Vim-Jinja2-Syntax set nocompatible " be iMpr ...

  2. 基于Pycharm的Python开发环境配置

    基于Pycharm的Python开发环境配置 编辑于2020-11-18 Python安装 双击桌面的Python3.x安装包. 勾选Add to path. 方便起见,选择Install now.下 ...

  3. nginx unit 1.8 支持基于java servlet 的开发模型

    最近unit 1.8 发布了,有两个比较大的新特性,内部请求路由,以及java servlet 容器应用的开发 内部请求路由配置参考 { "routes": [ { "m ...

  4. 基于linux运用python开发知识点滴

    我是小白,希望我的文章能对小白们有点作用. A.Linux的开源,优势明显,如何使用,基本命令如下: 个人认为最基础的两种操作: 1.文件操作: ls 看文件夹下内容 ls -a 隐藏文件 -l非隐藏 ...

  5. Ubuntu下基于Virtualenv构建Python开发环境

    1.安装virtualenv并建立虚拟环境 1).更新pip版本 sudo pip install --upgrade pip 如果出现如下异常: File , in <module> f ...

  6. 如何基于Jupyter notebook搭建Spark集群开发环境

    摘要:本文介绍如何基于Jupyter notebook搭建Spark集群开发环境. 本文分享自华为云社区<基于Jupyter Notebook 搭建Spark集群开发环境>,作者:apr鹏 ...

  7. delphi不同版本字符串类型的演化(要支持基于firemonkey的app调用,字符串最好使用olevariant类型)

    string,DELPHI2009以前的版本string=ansistring,一个字符占一个字节,DELPHI2009及以上版本string=unicodestring,一个字符占二个字节. cha ...

  8. Centos7.2下Nginx配置SSL支持https访问(站点是基于.Net Core2.0开发的WebApi)

    准备工作 1.基于nginx部署好的站点(本文站点是基于.Net Core2.0开发的WebApi,有兴趣的同学可以跳http://www.cnblogs.com/GreedyL/p/7422796. ...

  9. [转]基于Starling移动项目开发准备工作

    最近自己趁业余时间做的flash小游戏已经开发得差不多了,准备再完善下ui及数值后,投放到国外flash游戏站.期间也萌生想法,想把游戏拓展到手机平台.这两天尝试了下,除去要接入ane接口的工作,小游 ...

随机推荐

  1. 利用 FilesystemIterator 获取指定目录下的所有文件

    /** * 获取指定目录下的所有文件 * @param null $path * @return array */ public function getFileByPath($path = null ...

  2. tf-gpu报错:ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

    错误1:ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory 一般这种问题 ...

  3. ABP Framework 为什么好上手,不好深入?探讨最佳学习姿势!

    离写上一篇经验总结 ABP Framework 研习社经验总结(6.28-7.2) ,已经过去两周. ABP Framework 研习社(QQ群:726299208) 最近一周,又迎来了很多新伙伴,成 ...

  4. Exception 和Error异常大部分人都犯过的错。

    先看再点赞,给自己一点思考的时间,如果对自己有帮助,微信搜索[程序职场]关注这个执着的职场程序员. 我有什么:职场规划指导,技能提升方法,讲不完的职场故事,个人成长经验. 1,简介 Exception ...

  5. pod调度

    Pod调度 在默认情况下,一个pod在哪个node节点上运行,是由scheduler组件采用相应的算法计算出来的,这个过程是不受人工控制的. 但是在实际过程中,这并不满足需求,因为很多情况下,我们想控 ...

  6. ESP32的ULP 协处理器笔记

    1.ULP 协处理器是一个功耗极低的协处理器设备,无论主 CPU 是处于正常运行模式还是 Deep-sleep 模式,ULP 协处理器都可以独立运行.超低功耗协处理器的补充使得 ESP32 能够胜任一 ...

  7. MVP on Board 没用小技巧 👌

    七月入选了微软 MVP,本文记录 on board 过程中遇到的小问题和没用小技巧. MVP Portal 当你收到来自微软的确认邮件之后,你将正式被接纳为微软现任 MVP 的一员.从此刻开始,你便拥 ...

  8. (精)题解 guP2860 [USACO06JAN]冗余路径Redundant Paths

    (写题解不容易,来我的博客玩玩咯qwq~) 该题考察的知识点是边双连通分量 边双连通分量即一个无向图中,去掉一条边后仍互相连通的极大子图.(单独的一个点也可能是一个边双连通分量) 换言之,一个边双连通 ...

  9. C语言:预处理命令总结

    预处理指令是以#号开头的代码行,# 号必须是该行除了任何空白字符外的第一个字符.# 后是指令关键字,在关键字和 # 号之间允许存在任意个数的空白字符,整行语句构成了一条预处理指令,该指令将在编译器进行 ...

  10. python sqlite3 类

    import sys import os import sqlite3 ##sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/ ...