【转载】geany linux python编译器 开源
Geany 不好用,建议用一些好用的编辑器或ide
Subliem Text 或 VS code
Pycharm等。
设置运行环境
菜单栏–生成–设置生成命令–执行命令(execute)那里输入python3 %f
以后直接按F5键即可运行python文件.
设置代码检查
配置pep8
菜单栏–生成–设置生成命令–Lint–输入pep8 –max-line-length=80 "%f"
sudo pip3 install pep8
或者使用最新的pycodestyle进行代码检测.
sudo pip3 install pycodestyle
使用pep8
菜单栏–生成–Lint
使用空格代替制表符
菜单栏–编辑–首选项–编辑器–缩进–宽度:4,类型:空格,勾上"用Tab键缩进"
菜单栏–编辑–首选项–文件–保存文件–用空格替换制表符
代码格式化
使用black或着autopep8.
配置black或autopep8
sudo pip3 install black
或
sudo pip3 install autopep8
菜单栏–生成–设置生成命令–python命令部分–新增命令项:格式化python文件,black %f
或
菜单栏–生成–设置生成命令–python命令部分–新增命令项:格式化python文件,autopep8 -i %f
black使用方法
菜单栏–生成–格式化python文件,或者直接按F9格式化.
然后ctrl+r重新载入格式化的文件即可.
自动完成
配置snippets
菜单栏–工具–配置文件–snippets.conf,或者直接修改 ~/.config/geany/snippets.conf
官网来源https://wiki.geany.org/snippets/python/start
[Special]部分新增
wordchars=._abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
[Python]部分新增
for=for i in xrange(%cursor%):\n\t
doc=""" %cursor% """\n
elif=elif %cursor%:\n\t
else=else:\n\t%cursor%
if=if %cursor%:\n\t
from=from %cursor% import \n
main=if __name__ == '__main__':\n\t%cursor%
class=class %cursor%(object):\n\t""" Class doc """\n\t\n\tdef __init__ (self):\n\t\t""" Class initialiser """\n\t\tpass
def=def %cursor%(self):\n\t""" Function doc\n\n\t@param PARAM: DESCRIPTION\n\t@return RETURN: DESCRIPTION\n\t"""\n\t
get=def get%cursor%(self): return self._var\n
set=def set%cursor%(self): self._var = var\n
.=self.%cursor%
prop=property %cursor%:\n\tdef __get__(self):\n\t\treturn self.%cursor%_get()\n\n\tdef __set__(self, value):\n\t\tself.%cursor%_set(value)
try=try:\n\t%cursor%\nexcept Exception, e:\n\t
py=#!/usr/bin/env python\n#-*- coding:utf-8 -*-\n\n%cursor%
while=while %cursor%:\n\t
with=with %cursor%:\n\t
head="""\n\t%cursor%PROJECT – MODULE\n\n\tDESCRIPTION\n\n\t@copyright: {year} by {developer} <{mail}>\n\t@license: GNU GPL, see COPYING for details.\n"""\n
pp=from pprint import pprint\npprint(%cursor%)
cod=# coding: utf-8
dt=from datetime import datetime
使用方法,输入main,按tab,geany自动将main补全为if __name__ == '__main__':
代码提示
配置tag
官网下载tag文件https://wiki.geany.org/tags/start
解压后,把tag后缀的文件方法到~/.config/geany/tag目录即可
安装插件
配置插件:菜单栏–工具–插件管理器–勾选插件–点击窗口低下的配置按钮
官网地址:https://plugins.geany.org/
文件浏览器:sudo apt-get install geany-plugin-treebrowser
成对标签高亮:geany-plugin-pairtaghighlighter
自动高亮相同的字符:geany-plugin-automark
代码缩略图:geany-plugin-overview
虚拟终端支持:geany-plugin-multiterm
markdown支持:geany-plugin-markdown
python支持:geany-plugin-py(Provides most of the standard Geany C API for Python,该插件可以让geany支持python写的插件,比如geany pynav,也可以自己用python为geany写插件.)
xml美化:geany-plugin-prettyprinter
在实现和接口间跳转:geany-plugin-codenav
其他的小附加组件:geany-plugin-addons
在终端执行程序
菜单栏–编辑–首选项–虚拟终端–勾选“在虚拟终端中执行程序”
geany的插件文档
https://www.geany.org/manual/reference/index.html
配置pip国内的一些镜像
阿里云 https://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
~/.pip/pip.conf
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
【转载】geany linux python编译器 开源的更多相关文章
- Linux下部署开源版“禅道”项目管理系统《转载》
Linux下部署开源版“禅道”项目管理系统 https://www.cnblogs.com/xxsl/p/6525378.html
- 【转载】Linux中常用操作命令
说明:开始学习linux系统,为了方便查看,特转载一篇Linux中常用操作命令,转载地址:http://www.cnblogs.com/laov/p/3541414.html 正文: Linux简介及 ...
- Linux以外的开源操作系统大汇总
开源操作系统即公开源代码的操作系统软件,它遵循开源协议使用.编译和发布.自由和开放源代码软件中最著名的是Linux,它是一种类Unix的操作系统.Linux可安装在各种计算机硬件设备中,比如手机.平板 ...
- Python的开源人脸识别库:离线识别率高达99.38%
Python的开源人脸识别库:离线识别率高达99.38% github源码:https://github.com/ageitgey/face_recognition#face-recognitio ...
- linux python 安装 nose lapack atlas numpy scipy
linux python 安装 nose lapack atlas numpy scipy --http://lib.csdn.net/article/python/1262 作者:maple1149 ...
- 4 个快速的 Python 编译器 for 2018
简评:Python 和其他的解释型语言一样经常被吐槽性能不行,所以开发人员为了提升性能创建了不少编译器,本文则选取其中的四个做了基准测试. Python 其实是一种相当快的语言,但它并不像编译型语言那 ...
- Python的开源人脸识别库:离线识别率高达99.38%(附源码)
Python的开源人脸识别库:离线识别率高达99.38%(附源码) 转https://cloud.tencent.com/developer/article/1359073 11.11 智慧上云 ...
- 11 个最佳的 Python 编译器和解释器
原作:Archie Mistry 翻译:豌豆花下猫@Python猫 原文:https://morioh.com/p/765b19f066a4 Python 是一门对初学者友好的编程语言,是一种多用途的 ...
- kali linux Python开发环境初始化
kali linux Python 黑客编程1 开发环境初始化 为什么要选择Python? Python作为目前Linux系统下最流行的编程语言之一,对于安全工作者的作用可以和C++相提并论.Pyth ...
随机推荐
- PAT (Advanced Level) Practice 1031 Hello World for U (20 分) 凌宸1642
PAT (Advanced Level) Practice 1031 Hello World for U (20 分) 凌宸1642 题目描述: Given any string of N (≥5) ...
- PAT (Advanced Level) Practice 1001 A+B Format (20 分) 凌宸1642
PAT (Advanced Level) Practice 1001 A+B Format (20 分) 凌宸1642 题目描述: Calculate a+b and output the sum i ...
- 【软件推荐】利用Stylus修改网页显示字体
Windows下,字体的显示总是让人抓狂.抗锯齿效果让汉字显得粗细不均,甚至无法对齐的情况. 为了改善网页的显示效果,可以利用Stylus进行字体的替换 Stylus可以在Google的商店下载,由于 ...
- 看过这篇剖析,你还不懂 Go sync.Map 吗?
hi, 大家好,我是 haohongfan. 本篇文章会从使用方式和原码角度剖析 sync.Map.不过不管是日常开发还是开源项目中,好像 sync.Map 并没有得到很好的利用,大家还是习惯使用 M ...
- 【笔记】《Redis设计与实现》chapter21 排序
chapter21 排序 21.1 SORT<key> 命令的实现 // 用于保存被排序值及其权重的结构 typedef struct _redisSortObject { // 被排序键 ...
- JetBrains系列IDE无法输入中文
1 问题描述 环境Linux+fcitx,JetBrains的IDE无法输入中文,包括IDEA,PyCharm,WebStorm,CLion等等. 2 解决方案 Linux下一般使用fcitx进入中文 ...
- LNMP架构上线动态网站
第一步,一键安装所需程序 yum install -y nginx php php-mysql php-fpm mariadb-server 第二步,修改Nginx配置文件/etc/nginx/ngi ...
- 你已经用上 5G 网络了吗?
随着各大手机厂商陆续推出 5G 手机,智能手机全面迎来 5G 浪潮.可能有人会发问:如此推崇 5G,5G 能为我们带来什么,我们的生活又会因此而改变多大呢? 什么是 5G? 简单地说,5G 就是第五代 ...
- shellcode隐写到像素RGB免杀上线到CS
利用把Shellcode隐写到图片像素RGB进行免杀上线到CS --by:chenw 0x01 前言 前几天跟一个朋友一起搞一个站的时候,发现那个站点开了很多杀软,使用CS的powershell马无法 ...
- 996. Number of Squareful Arrays
Given an array A of non-negative integers, the array is squareful if for every pair of adjacent elem ...