摘要: seg1=''' <!DOCTYPE HTML>\n<html>\n<body>\n<meta charset=gb> <h2 align=center>Python成绩登记信计</h2> <table border='1' align="center" width=70%> <tr bgcolor 阅读全文
posted @ 2020-06-10 21:33 liuchun玲 阅读(181) 评论(0) 推荐(0) 编辑
摘要: readlines()读取所有内容,返回列表 打开文件的模式有: r,只读模式(默认)。 w,只写模式。【不可读:不存在则创建;存在则删除内容,重写内容;】 a,追加模式。【可读;不存在则创建;存在则只追加内容;】 “+”表示可以同时读写某个文件 r+,可读写文件。【可读;可写;可追加】 w+,写读 阅读全文
posted @ 2020-06-10 20:22 liuchun玲 阅读(116) 评论(0) 推荐(0) 编辑
摘要: import requests from bs4 import BeautifulSoup import bs4 info=[] url ="http://www.zuihaodaxue.com/zuihaodaxuepaiming2018.html" try: r=requests.get(url 阅读全文
posted @ 2020-05-16 14:42 liuchun玲 阅读(101) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鸟教程(runoob.com)</title> </head> <body> <h1>欢迎您的加入23</h1> <p>有你想不到的意外哦!</p> </body> <table 阅读全文
posted @ 2020-05-16 13:23 liuchun玲 阅读(97) 评论(0) 推荐(0) 编辑
摘要: import requests def getHTMLText(url): try: r=requests.get(url,timeout=30) r.raise_for_status() r.encoding='utf-8' return r.text except: return "" url= 阅读全文
posted @ 2020-05-16 10:12 liuchun玲 阅读(63) 评论(0) 推荐(0) 编辑
摘要: from random import random def printIntro(): #打印程序介绍信息 print("19信计1班23号刘春玲进行比赛分析结果:") print("这个程序模拟两个选手A和B的某种竞技比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)") 阅读全文
posted @ 2020-05-16 09:40 liuchun玲 阅读(75) 评论(0) 推荐(0) 编辑
摘要: #接收代码 import socket # 使用IPV4协议,使用UDP协议传输数据 s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # 绑定端口和端口号,空字符串表示本机任何可用IP地址 s.bind(('', 5000)) while Tru 阅读全文
posted @ 2020-05-12 21:47 liuchun玲 阅读(135) 评论(0) 推荐(0) 编辑
摘要: from PIL import Image from PIL import ImageEnhance import numpy as np # image = Image.open('file:///C:/Users/25764/Desktop/新建位图图像.bmp') #image.show() 阅读全文
posted @ 2020-05-06 20:09 liuchun玲 阅读(99) 评论(0) 推荐(0) 编辑
摘要: from PIL import Image import numpy as np vec_el = np.pi/2.2 # 光源的俯视角度,弧度值 vec_az = np.pi/4. # 光源的方位角度,弧度值 depth = 10. # (0-100) im = Image.open('C:/Us 阅读全文
posted @ 2020-05-06 19:05 liuchun玲 阅读(128) 评论(0) 推荐(0) 编辑
摘要: import numpy as np import matplotlib.pyplot as plt import matplotlib matplotlib.rcParams['font.family']='SimHei' matplotlib.rcParams['font.sans-serif' 阅读全文
posted @ 2020-05-06 16:16 liuchun玲 阅读(89) 评论(0) 推荐(0) 编辑