python
nicholas_dfx
南京--电子工程师、软件工程师、控制工程师,物联网,工控,工业互联,嵌入式
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python WingIDE中文乱码修复
原创 2018-07-08 10:12:38 · 5831 阅读 · 1 评论 -
matplotlib报错:RuntimeWarning: More than 20 figures have been opened
RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (matplotlib.pyplot.figure) are retained until explicitly closed and may consume too much memory.循环...原创 2019-03-13 23:18:39 · 10348 阅读 · 0 评论 -
转载--一张图学python
转载 2019-01-08 10:36:36 · 3127 阅读 · 0 评论 -
python时间和相对时间
库为:import datetimefrom dateutil.relativedelta import relativedelta 上个月或下个月print(datetime.date.today())print(datetime.date.today() - relativedelta(months=+1))原创 2019-01-08 10:32:22 · 4005 阅读 · 0 评论 -
matplotlib画图显示中文
matplotlib中画图legend默认都是英文,如果要修改为中文,需要额外添加中文字体如:ax.legend(legend,title='中文测试',loc=1,markerscale=0.3,bbox_to_anchor=(1.15,1.18),prop={'family':'SimHei','size':15})...原创 2018-12-24 11:31:45 · 3278 阅读 · 0 评论 -
树莓派 远程桌面 xrdp
xrdp的效果远强于vnc,而且可以直接用windows的远程桌面访问(美中不足的时不能相互拷贝文件和文本)安装步骤如下:1. 先安装tightvncserversudo apt-get install tightvncserver2. 再安装xrdp服务。sudo apt-get install xrdp3. 如果开着防火墙ufw , 那么打开服务器上的远程桌面访问端口sudo ufw allo...原创 2018-07-05 22:08:24 · 3092 阅读 · 0 评论 -
树莓派pip安装库错误
报错:ValueError: bad marshal data (unknown type code) python出现这玩意,一般来说是你的前后的编译器有不相同造成的。前后安装了2个版本的Py一个是2.7 一个是3.5 的所以在2.7的时候跑了,造成了安装3.5之后就会出问题。解决方案就是将对应的包目录下的.pyc文件删除,让python编译器重新生成编译就OK了。执行find...原创 2018-07-05 22:07:36 · 4357 阅读 · 0 评论 -
python3 爬虫 HTTP Error 403:Forbidden
问题描述初学python,在用python中的urllib.request.urlopen()方法打开网页时,有些网站会抛出异常: HTTP Error 403:Forbidden问题原因网站对爬虫的操作进行了限制解决方法伪装成浏览器,然后这样用headers = {'User-Agent':'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gec...原创 2018-07-09 14:57:12 · 6589 阅读 · 0 评论 -
Pycharm Assert断言
# 以下 test 开头的函数是单元测试def test_parsed_url(): """ parsed_url 函数很容易出错, 所以我们写测试函数来运行看检测是否正确运行 """ http = 'http' https = 'https' host = 'g.cn' path = '/' test_items = [ ('http...原创 2018-07-09 14:55:45 · 8372 阅读 · 0 评论 -
一张图学Python
原创 2018-07-09 14:54:44 · 4711 阅读 · 0 评论 -
Python pass 语句
Python pass是空语句,是为了保持程序结构的完整性。pass 不做任何事情,一般用做占位语句。Python 语言 pass 语句语法格式如下:pass实例:#!/usr/bin/python# -*- coding: UTF-8 -*- # 输出 Python 的每个字母for letter in 'Python': if letter == 'h': pass p...原创 2018-07-09 14:53:27 · 4701 阅读 · 0 评论 -
如何在linux下安装pip
安装pip的方法:Install pip and virtualenv for Ubuntu 10.10 Maverick and newer$ sudo apt-get install python-pip python-dev build-essential$ sudo pip install --upgrade pip$ sudo pip install --upgrade ...原创 2018-07-09 09:01:08 · 5926 阅读 · 0 评论 -
grafana简介以及grafana从mysql获取数据绘制折线图
1、可视化工具Grafana:Grafana是一个跨平台的开源的度量分析和可视化工具,可以通过将采集的数据查询然后可视化的展示,并及时通知。1、展示方式:快速灵活的客户端图表,面板插件有许多不同方式的可视化指标和日志,官方库中具有丰富的仪表盘插件,比如热图、折线图、图表等多种展示方式;2、数据源:Graphite,InfluxDB,OpenTSDB,Prometheus,Elasticsea...原创 2019-09-30 10:28:40 · 9591 阅读 · 0 评论
分享