![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
zmjames2000
这个作者很懒,什么都没留下…
展开
-
python 记录
软件安装 :https://www.anaconda.com/distribution/数据出炉:http://pandas.pydata.org/pandas-docs/stable/user_guide/index.html原创 2019-02-16 11:05:55 · 71 阅读 · 0 评论 -
python---deel with data by pandas
Original: http://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#excel-filesExcel filesThe read_excel() method can read Excel 2003 (.xls) and Excel 2007+ (.xlsx) files using the xlrd Python...原创 2019-02-16 11:26:43 · 199 阅读 · 0 评论 -
Python 获取命令行参数
come from :https://blog.csdn.net/u011520181/article/details/79955927一、sys 模块在 Python 中,通过 sys 模块中的 sys.argv 可以访问到所有的命令行参数,它的返回值是包含所有命令行参数的列表。sys.argv :是命令行参数列表len(sys.argv) :是命令行参数个数sys.argv...转载 2019-02-28 09:37:54 · 673 阅读 · 0 评论 -
Python 获取指定文件夹下的目录和文件
come form :https://blog.csdn.net/u011520181/article/details/80866790经常有需要扫描目录,对文件做批量处理的需求,所以对目录处理这块做了下学习和总结。Python 中扫描目录有两种方法:os.listdir 和 os.walk。一、os.listdir 方法os.listdir() 方法用于返回指定的目录下包含的文件或子...转载 2019-02-28 09:37:59 · 591 阅读 · 0 评论 -
Anaconda中的Spyder开发环境增添代码提示功能
最近发现在电脑完成基于Anaconda的TensorFlow安装后,使用Spyder并没有自动补齐的功能,使用起来很烦人,现提供以下解决方法:(1)按照anaconda3的安装路径找到如下的py文件。(2)修改module_completion.py参数的相关模块。如下,加入tensorflow(3)删除该路径下的submodules文件(4)重新启动即可!-------...转载 2019-03-02 23:55:15 · 300 阅读 · 0 评论 -
《python数据分析常用手册》一、NumPy和Pandas篇 ----Good
come from :https://www.cnblogs.com/prpl/p/5537417.html一、常用链接:1.Python官网:https://www.python.org/2.各种库的whl离线安装包:http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn3.数据分析常用库的离线安装包(pip+wheels)(...转载 2019-03-02 11:20:07 · 1023 阅读 · 0 评论 -
numpy ------Good
come from :https://blog.csdn.net/jayloncheng/article/category/7643404numpy数组的创建一、用python列表创建数组import numpy as npnp.array([1,2,3,4])#用列表创建一维数组np.array([1,2,3,4],dtype='float')#在创建时用关键字dtype明确...转载 2019-03-02 11:10:24 · 181 阅读 · 0 评论 -
Python第一天:你必须要知道的Python擅长领域以及各种重点学习框架(包含Python在世界上的应用)
come from :https://www.cnblogs.com/CoXieLearnPython/p/9514459.html目录Python5大擅长领域 WEB开发 网络编程 科学运算 GUI图形开发 运维自动化Python在世界上的知名应用国外 谷歌 CIA NASA YouTube Dropbox Inst...转载 2019-03-03 10:59:01 · 169 阅读 · 0 评论 -
1.正则表达式 简单学习
\n 换行符 \t 制表符\w 匹配一个字母,数字,下划线 word\W 除\w了以外的任意字符\d 十进制数 digit\D 除十进制数之外的任务字符\s 空白字符 [\s]表示,只要出现空白就匹配\S 除空白字符任意字符 space [\S]表示,非空白就匹配原子表 [] : ...原创 2019-09-07 19:28:00 · 141 阅读 · 0 评论 -
3. 异常处理模版 及状态码查询
file.getcode()网页状态码查询:https://www.runoob.com/http/http-status-codes.html简单模版import urllib.requestimport urllib.errortry: data = urllib.request.urlopen('http://blog.csdn.net')except u...原创 2019-09-07 19:55:44 · 102 阅读 · 0 评论 -
2. urllib基础说明
主要是 urlretrieve(), urlcleanup(), info(), getcode()urlretrieve("网址地址","本地路径(带后缀名)")urlcleanup() 删除缓存file = urllib.request.urlopen("web.htm")print (file.info()) #获得页面的信息print (file.getcode()) ...原创 2019-09-07 19:43:01 · 173 阅读 · 0 评论 -
1. 主要内容
QT designerPyQt5 基本窗口控件:QMainWindow,Qwidget,Qlabel,QLineEdit,等PyQt5高级组件:QTableView, QListView,容器,多线程等PyQt5布局管理:QBoxLayout, QGridLayout,QFormlayout, 嵌套布局等PyQt5信号与槽:事件处理,数据传递等PyQt5图形与特效:定制窗口风格...原创 2019-09-07 20:12:10 · 110 阅读 · 0 评论 -
2.使用QTdesigner工具
将.ui文件转化 .py文件方法1. python -m PyQt5.uic.pyuic demo.ui -o demo.py方法2 pyuic5 demo.ui -o demo.pypyuic5 /anaconda3/pkgs/pyqt-5.9.2/bin/pyuic5pyuic5.bat@D:/Anaconda3\python.exe -m PyQt5.uic.pyu...原创 2019-09-07 20:16:35 · 250 阅读 · 0 评论 -
3.主窗口类型QMainWindow,QWidget,QDialog
主窗口类型:QMainWindow: 可以包含菜单栏,工具栏,状态栏和标题栏,是最常见的窗口形式QWidget: 不确定窗口的用途的时候, 就用这个。QDialog: 是对话窗口的基类。是没有工具栏,状态栏,菜单栏的。简单案例:from PyQt5.QtWidgets import QApplication,QWidget,QMainWindow,QPushButto...原创 2019-09-07 20:22:51 · 269 阅读 · 0 评论 -
4.控件提示信息QToolTip
简单案例from PyQt5.QtWidgets import QMainWindow,QApplication,QToolTip,QPushButton,QHBoxLayout,QWidgetfrom PyQt5.QtGui import QIcon,QFontimport sysclass TooltipForm(QMainWindow): def __init__(se...原创 2019-09-07 20:25:53 · 376 阅读 · 0 评论 -
1.《利用python进行数据分析》读书笔记 ——第一章,第二章
import jsonimport numpy as npimport pandas as pdimport matplotlib.pyplot as pltfrom collections import defaultdictfrom collections import Counterpath = r'..\test_file\0636920023784-master\c...原创 2019-09-09 19:31:25 · 238 阅读 · 0 评论 -
4.浏览器伪装技术
1.用户伪装uapools = [ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/5...原创 2019-09-09 20:31:36 · 690 阅读 · 0 评论 -
5. 抓包分析
参考:https://www.cnblogs.com/yyhh/p/5140852.htmlFiddler是以代理web服务器的形式工作的,它使用的代理地址是127.0.0.1,port:8888当fiddler会自动设置代理,退出的时候它会自动注销代理,不会影响其他程序。Fiddler主要是设置的是过滤会话。1.过滤功能开启2.过滤功能设置3.过滤类型设置4.过...原创 2019-09-09 20:38:22 · 150 阅读 · 0 评论 -
6. scrapy框架基础
使用scray可以提高开发效率,并且非常适合做一些中大型的爬虫项目urllib适合写一些爬虫文件,scrapy适合做一些爬虫项目安装教程:1. update pip: python -m pip install --upgrade pip2. install wheel: pip install wheel3.install lxml : 下载安装(ldf网站) p...原创 2019-09-09 20:52:42 · 153 阅读 · 0 评论 -
debug函数
像linux一样 使用 __func__,__line__,def debug(message):import sysimport inspectcallerframerecord = inspect.stack()[1]# 0代表当前行 , 1当前调用frame = callerframerecord[0]info = insp...原创 2019-09-09 20:41:05 · 769 阅读 · 0 评论 -
5.QLable控件
QLabel控件setAlignment() 设置文件的对齐方式setIndent()设置文本缩进text()获取文本内容setBuddy() 设置伙伴关系setText()设置文本内容selectedText() 返回选择的字符setWordWrap() 设置是否允许换行常用的信号(事件);1.当鼠标滑过QLabel控件时触发: linkHovered2....原创 2019-09-09 21:01:43 · 287 阅读 · 0 评论 -
6.QLineEdit 控件与回显模式EchoMode
Normal NoEcho 不回显, linux中输入密码,不显示 Password 模式 sha md5 PasswordEchoOnEdit 先显示A,过1s就显示※#placeholdertext 文本编辑框显示灰色的内容,默认是灰色的 def initUI(self): print('initUI ...') # self.s...原创 2019-09-09 21:04:11 · 731 阅读 · 0 评论 -
6.QLineEdit 控件 校验器
如限制只能输入整数,浮点数,或满足一定条件的字符串def initUI(self): # self.setGeometry(300,300, 500,500) self.move(500,500) self.setWindowTitle('QLineEditValidator') intLineEdit = QLineEdit...原创 2019-09-09 21:05:58 · 467 阅读 · 0 评论 -
6.QLineEdit 控件 input Mask
input maskdef initUI(self): # self.setGeometry(300,300, 500,500) self.move(500,500) self.setWindowTitle('QLineEditValidator') #192.168.21.45 ipLineEdit = QL...原创 2019-09-09 21:09:03 · 1726 阅读 · 0 评论 -
7.QTextEdit 控件
def initUI(self): self.setWindowTitle('QLineEditDemo') self.setGeometry(500,500,300,200) self.textEdit = QTextEdit() #用self是为了函数能直接调用 self.buttonText = QPushButton...原创 2019-09-09 21:10:14 · 190 阅读 · 0 评论 -
18.QColorDialog 颜色选择对话框
def initUI(self): self.setWindowTitle('QFontDialogDemo') self.setGeometry(500,500,300,200) fontButton1 = QPushButton('选择颜色') fontLabel = QLabel('hello 测试字体') ...原创 2019-09-10 11:24:52 · 254 阅读 · 0 评论 -
19.QFileDialog 文件选择对话框
def initUI(self): self.setWindowTitle('QFileDialogDemo') self.setGeometry(500,500,300,200) button1 = QPushButton() button1.setText('加载图片') button1.clicked.con...原创 2019-09-10 11:27:38 · 209 阅读 · 0 评论 -
20.case QDiaglog
from PyQt5.QtWidgets import QMainWindow,QWidget,QDialog,QPushButton,QApplication,QDesktopWidget,QHBoxLayout,QVBoxLayout,QFormLayout,QGridLayout,\ QToolTip,QLabel,QLineEdit,QTextEdit,QRadioButton,Q...原创 2019-09-10 11:29:37 · 122 阅读 · 0 评论 -
13.分布式爬虫 Docker
Docker+Redis+UriLib+mysqlDocker+Redis+Scrapy+Scrapy-Redis+MySql容器化虚拟机创建虚拟机非常的快,启动也非常的快,部署10几个虚拟机也是非常的容易,也不会卡。所以Dokcer部署轻快,性价比高linux 安装 yum -y install docker基本介绍systemctl start dockersystemct...原创 2019-09-11 15:52:08 · 138 阅读 · 0 评论 -
14.分布式爬虫 Redis基础
Redis基础docker attach 3ba4apt-get install redis-server启动: /etc/init.d/redis-server restart退出:exit查看是否能ping通: redis-cli -h 127.0.0.1 -o 6379Redis命令redis-cli -h 127.0.0.1 p 6379set hello 12345...原创 2019-09-11 16:00:13 · 91 阅读 · 0 评论 -
15.分布式爬虫 mysql
默认redis和mysql是不支持远程连接的mysql制作一个镜像文件docker run --tid --name center 3a54 (默认的ubutun)docker ps -a配置中心节点docker attach 2eafcat /etc/hostsmysql -h 127.0.0.1 -u root -ppassword/etc/init.d/mysql re...原创 2019-09-11 16:25:57 · 161 阅读 · 0 评论 -
21.绘图API
1.文本2.各种图形(直线,点,椭圆,弧,扇形,多边形等)3.图像QPainterpainter = QPainter()painter.begin(self)painter.drawText(…)painter.end()必须在painEvent事件方法中绘制各种元素本质上,窗口尺寸的改变,paintEvent就会触发,重新绘制def initUI(self): ...原创 2019-09-11 16:36:16 · 121 阅读 · 0 评论 -
22.正弦曲线
def paintEvent(self,event): painter = QPainter() painter.begin(self) painter.setPen(Qt.blue) size = self.size() for i in range(1000): x = 100*(-1+...原创 2019-09-11 16:38:59 · 297 阅读 · 0 评论 -
23.绘制直线
def paintEvent(self,event): painter = QPainter() painter.begin(self) painter.setPen(Qt.blue) pen = QPen(Qt.red, 3, Qt.SolidLine) #Qt.DashLine 虚线 Qt.DashDotDotLine 点划线...原创 2019-09-11 20:13:30 · 127 阅读 · 0 评论 -
24.绘制各种弧,圆形,椭圆,多边形,
def paintEvent(self,event): qp = QPainter() qp.begin(self) qp.setPen(Qt.blue) #绘制弧 rect = QRect(0,10,100,100)#左上角点,长度,宽 度 qp.drawArc(rect, 0, 50*16) # a...原创 2019-09-11 20:16:27 · 278 阅读 · 0 评论 -
25.用画刷填充图形区域
def paintEvent(self,event): qp = QPainter() qp.begin(self) qp.setPen(Qt.red) brush = QBrush(Qt.SolidPattern) qp.setBrush(brush) qp.drawRect(10,15,90,60...原创 2019-09-11 20:18:28 · 435 阅读 · 0 评论 -
深度学习基础介绍(收集)
1. 深度学习的起源及其发展—详细介绍感知机------->多层感知机------->BP算法—神经网络的崛起------->2006年 深度学习此后,逐渐发展起来的有CNN(卷积神经网络),RNN(循环神经网络),递归神经网络,LSTM长短时记忆,增强学习(Q-learning)等算法推动了深度学习的急速的发展.目前,深度学习主要运用于以下几个方面:NLP(自然语言处...原创 2019-09-17 09:26:54 · 749 阅读 · 0 评论 -
TensorFlow和Caffe、MXNet、Keras等其他深度学习框架的对比
主流深度学习框架对比深度学习研究的热潮持续高涨,各种开源深度学习框架也层出不穷,其中包括 TensorFlow、Caffe、Keras、CNTK、Torch7、MXNet、Leaf、Theano、DeepLearning4、Lasagne、Neon 等等。然而 TensorFlow 却杀出重围,在关注度和用户数上都占据绝对优势,大有一统江湖之势。表 2-1 所示为各个开源框架在GitHub上的...转载 2019-09-27 09:14:22 · 191 阅读 · 0 评论 -
win10安装pytorch
https://pytorch.org/https://pytorch.org/get-started/previous-versions/添加清华镜像1 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/2 conda config --add channels http...转载 2019-09-27 16:07:49 · 181 阅读 · 0 评论 -
如何彻底的卸载anaconda(包括配置文件)
Solution A通常卸载软件,直接运行uninstall就可以了,对于anaconda也一样,可以直接运行安装目录下的 Uninstall-Anaconda3.exe 即可,但是这样卸载并没有完全卸载。如果需要完全卸载请参考 Solution BSolution B通过B方式卸载,请确保还没有通过A方式进行卸载。1.安装 Anaconda-Clean package打开 ...转载 2019-09-27 22:33:05 · 3415 阅读 · 1 评论