- 博客(14)
- 资源 (9)
- 收藏
- 关注
原创 Python3 正则表达式
Python3 正则表达式正则表达式是一个特殊的字符序列,它能帮助你方便的检查一个字符串是否与某种模式匹配。Python 自1.5版本起增加了re 模块,它提供 Perl 风格的正则表达式模式。re 模块使 Python 语言拥有全部的正则表达式功能。compile 函数根据一个模式字符串和可选的标志参数生成一个正则表达式对象。该对象拥有一系列方法用于正则表达式匹配和替换。re...
2019-12-29 11:05:32 958
原创 Python标准库模块之heapq
Python标准库模块heapq该模块提供了堆排序算法的实现。堆是二叉树,最大堆中父节点大于或等于两个子节点,最小堆父节点小于或等于两个子节点。创建堆heapq有两种方式创建堆, 一种是使用一个空列表,然后使用heapq.heappush()函数把值加入堆中,另外一种就是使用heap.heapify(list)转换列表成为堆结构import heapq# 第一种"""...
2019-12-26 15:17:17 1053
原创 Python 3.8 与老版本的不同要点
1、print 打印内容要用括号括起来。 例如:print(’ Hello Tvm-ERP ')2、reload重载模块前需要先执行import importlib 。 例如:import hello2 import importlib importlib.reload(hello2) #...
2019-12-25 20:44:37 5387
原创 Pyinstaller打包Py程序成exe
通常情况下安装我们都会首选国内镜像进行安装,快捷方便。使用pip install pyinstaller 安装但有时会安装不成功,笔者就遇到了。如果上述安装木成功,首先升级一下你的pip之后直接运行 pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz从其官网上直接进行下载安装...
2019-12-24 08:53:31 158
原创 Python中的eval、exec、globals、locals及compile函数
1. eval函数函数的作用:计算指定表达式的值。也就是说它要执行的Python代码只能是单个运算表达式(注意eval不支持任意形式的赋值操作),而不能是复杂的代码逻辑,这一点和lambda表达式比较相似。函数定义:eval(expression, globals=None, locals=None)参数说明:expression:必选参数,可以是字符串,也可以是一个任意...
2019-12-21 14:55:27 2216
原创 Hadoop-3 Windows安装
Hadoop-3.0.0版本Windows安装一 、安装Hadoop从http://archive.apache.org/dist/hadoop/core/下载Hadoop-3.0.0,下载二进制压缩包文件:hadoop-3.0.0.tar.gz,也可以在我的云盘里下载:链接:Hadoop-3.0.0提取码:f5kq...
2019-12-18 13:45:54 557
原创 python3 urllib及requests基本使用
在python3中,urllib是请求url连接的标准库1、urllib.request request主要负责构建和发起网络请求 1)GET请求(不带参数) response =urllib.request.urlopen(url,data=None,[timeout,]*) 返回的response是一个http.client.HTTPResponse ...
2019-12-17 15:23:09 2841
原创 python3处理pdf工具 pdfminer3k
pdfminer3k应用python处理pdf也是常用的技术了,pdfminer3k是一个非常好的工具。先在系统目录下建立pip目录,呈现 C:\Users\Administrator\pip,之后建立pip.ini文本文件,内容如下:[global]index-url=http://mirrors.aliyun.com/pypi/simple/[install]trusted-...
2019-12-17 15:16:23 1726
原创 将pip源更换到国内镜像
将pip源更换到国内镜像用pip管理工具安装库文件时,默认使用国外的源文件,因此在国内的下载速度会比较慢,可能只有50KB/s。幸好,国内的一些顶级科研机构已经给我们准备好了各种镜像,下载速度可达2MB/s。其中,比较常用的国内镜像包括:(1)阿里云 http://mirrors.aliyun.com/pypi/simple/(2)豆瓣http://pypi.douban.com/sim...
2019-12-16 11:40:26 296
原创 HTTPrequest对象
from django.shortcuts import renderdef login(request): #request参数就是HTTPrequest对象 print(request)#<WSGIRequest: GET '/login/'> #返回请求的路径,纯路径 print(request.path)#/login/ #返回请求的路...
2019-12-15 10:28:07 429
原创 POST请求数据传输
#方式一:def login(request): #获取请求的方式是GET还是POST path=request.method #当请求方式是GET的时候返回login页面 if path=='GET': return render(request,'login.html') else: #为POST的时候,判断用户名和密码...
2019-12-15 10:23:55 337
原创 Djiango路由分发
# 无名分组参数 url(r'^articles/(\d+)/(\d+)/', views.articles), #articles/2019/9/ def articles(request,year,month): # 位置参数 2019 9 print(year,type(year)) #2019 <class 'str'> #匹配出来的所有...
2019-12-15 10:19:13 221
原创 Django项目目录结构
#manage.py ----- Django项目里面的工具,通过它可以调用django shell和数据库,启动关闭项目与项目交互等,不管你将框架分了几个文件,必然有一个启动文件,其实他们本身就是一个文件。#settings.py ---- 包含了项目的默认设置,包括数据库信息,调试标志以及其他一些工作的变量。#urls.py ----- 负责把URL模式映射到应用...
2019-12-15 10:11:37 419
原创 Django框架的下载安装
#下载 1、离线下载安装包,之后解压缩至指定目录 运行 python setup.py install2、在线安装包pip3 install django==3.0a1pip3 install django==3.0a1 -i http://xxxxxx 指定源Django核心命令1、在指定路径按照给定名称创建Django工程 基本用法:django-admi...
2019-12-15 10:00:49 549
delphixe好用的AES加解密资源库
2020-08-21
qrcode(好用的D7二维码控件).rar
2020-07-18
DELPHI7托盘图标控件,230(好用).zip
2020-07-13
D7下好用的EhLib36(好用).rar 控件
2020-07-13
考勤机二次开发包
2012-06-27
为vs2008提供jquery智能提示
2010-04-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人