上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页
摘要: import time from concurrent.futures import ThreadPoolExecutor import threading import os def work(n): print(f'给{n}打电话,进程号是:{os.getpid},线程号是:{threading 阅读全文
posted @ 2020-06-23 11:37 马蹄哒哒 阅读(201) 评论(0) 推荐(0)
摘要: import requestshtml=requests.get('url')soup=BeautifulSoup(html.text,'lxml') 解析器的种类: html.parser: python自带,但容错性不够高 lxml: 解析速度快,需额外安装(推荐使用) xml: 同lxml库, 阅读全文
posted @ 2020-06-22 17:18 马蹄哒哒 阅读(1002) 评论(0) 推荐(0)
摘要: import os import pymysql from fnmatch import fnmatch aaa=input(r'请输入存放作业的绝对路径:') filename=os.listdir(aaa) #获取绝对路径 import pymysql import pandas db=pymy 阅读全文
posted @ 2020-06-21 21:09 马蹄哒哒 阅读(115) 评论(0) 推荐(0)
摘要: import requests #需要请求的目标地址 url='http://www.rrys2019.com/user/user' headers={'user-agent':'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) Apple 阅读全文
posted @ 2020-06-21 16:46 马蹄哒哒 阅读(330) 评论(0) 推荐(0)
摘要: import requests url='https://fanyi.baidu.com/sug' headers={'user-agent':'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KH 阅读全文
posted @ 2020-06-21 15:47 马蹄哒哒 阅读(236) 评论(0) 推荐(0)
摘要: from matplotlib import pyplot import numpy def f(x,y): return (1-x/2+x**5)*numpy.exp(-x**2-y**2) n=256 x=numpy.linspace(-3,3,n) y=numpy.linspace(-3,3, 阅读全文
posted @ 2020-06-20 21:39 马蹄哒哒 阅读(134) 评论(0) 推荐(0)
摘要: import numpy from matplotlib import pyplot n=12 x=numpy.arange(12) y1=(1-x/float(n))*numpy.random.uniform(0.5,1.0,n) y2=(1-x/float(n))*numpy.random.un 阅读全文
posted @ 2020-06-20 21:21 马蹄哒哒 阅读(109) 评论(0) 推荐(0)
摘要: (一) 加减法 import numpy a=numpy.arange(27).reshape(3,9) b=numpy.arange(2,29).reshape(3,9) #加: c=a+b d=numpy.add(a,b) #减: e=a-b f=numpy.subtract(a,b) (二)乘 阅读全文
posted @ 2020-06-20 13:24 马蹄哒哒 阅读(951) 评论(0) 推荐(0)
摘要: import pickle d1={'a':234,'b':[3,5,7],'w':[4,5]} #存储数据 f=open(r'D:\matplotlib绘图\aaa.pickle','wb') pickle.dump(d1,f) f.close() #读取数据 with open(r'D:\mat 阅读全文
posted @ 2020-06-19 21:08 马蹄哒哒 阅读(1671) 评论(0) 推荐(0)
摘要: Python 正则 什么是正则# 正则表达式是对字符串(包括普通字符(例如,a 到 z 之间的字母)和特殊字符(称为元字符))操作的一种逻辑公式,就是用事先定义好的一些特定字符、及这些特定字符的组合,组成一个规则字符串,这个规则字符串用来表达对字符串的一种过滤逻辑。正则表达式是一种文本模式,该模式描 阅读全文
posted @ 2020-06-19 16:31 马蹄哒哒 阅读(300) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页