![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
runze
少儿编程侯老师
这个作者很懒,什么都没留下…
展开
-
runze - 飞机大战
# 1。导入工具包import pygameimport sys# 战机# 属性:x,y ,皮肤,游戏窗口,速度,攻速,血量,伤害# 方法:show,移动(鼠标、键盘), 开火class zhanji: def __init__(self, screen): self.x = 100 self.y = 100 self.pifu = pygame.image.load("飞机大战类游戏飞机素材-飞行物-神平面(GodPlane)_爱给网_原创 2020-07-25 18:55:38 · 204 阅读 · 0 评论 -
runze - word和圆周率
# pip install python-docxfrom docx import Document# 1。新建1个空白文档doc1 = Document()# 2.新建文档标题 add_heading(内容,几级标题)doc1.add_heading("π",1)def pi(n): p = 10 ** (n + 10) # 准备初始整数,先多乘 k 个 0,以增加精度,最后再去掉,这里我取 k=10 a = p * 16 // 5 # 第一项的前半部分原创 2020-06-20 18:53:06 · 124 阅读 · 0 评论 -
runze-预测鸢尾花
from sklearn import datasetsimport matplotlib.pyplot as pltplt.rcParams["font.sans-serif"] = ["SimHei"]flower_data = datasets.load_iris()print(flower_data)# 网络 github# 花萼长度 花萼宽度 花瓣长度 花瓣宽度# 0 山鸢尾花 1变色鸢尾花 2 维吉尼亚鸢尾花import pandas as pdflowe原创 2020-06-13 18:53:26 · 188 阅读 · 0 评论 -
runze - 机器学习
import matplotlib.pyplot as pltx = [[25], [27], [31], [33], [35]]y = [[110], [115], [155], [160], [180]]x_predict = [[11]]plt.plot(x,y,'o')plt.show()from sklearn import linear_model# 新建一个模型训练对象model = linear_model.LinearRegression()# 训练数据mo.原创 2020-05-16 18:57:47 · 146 阅读 · 0 评论 -
runze - 制作二维码
import MyQR.myqr as mqmq.run('https://www.bilibili.com/video/av455282854/', picture= 'hr.gif',colorized=True, save_name='hrtg.gif')原创 2020-05-09 18:47:22 · 206 阅读 · 1 评论 -
runze - 资金分配游戏折线图
import randomimport matplotlib.pyplot as pltpeople = 10x = {}for i in range(people): x[i] = [random.randint(0,200)]coin = 10# 第一次分钱# 减少钱数# [100]# [100, 99]# person = list(x.keys())pl...原创 2020-05-02 18:53:09 · 319 阅读 · 1 评论 -
runze - 资金分配游戏
import randomimport matplotlib.pyplot as plt"""1。政府补助2.如果一个人破产有没有机会达到前几名?3.出生身价能不打破阶层?4. 社会资源总和,生产力,减1块钱并得到10块钱5. 每个人获得钱是随机的?"""plt.rcParams["font.sans-serif"] = ["SimHei"]# 产生数据x = [] #...原创 2020-04-25 18:52:45 · 244 阅读 · 0 评论 -
runze-学习数据分析
import matplotlib.pyplot as pltimport math# 量化交易x = []y = []for i in range(0, 60): x.append(i) y.append(i)# bar 柱子# plt.plot(x,y)plt.scatter(x,y)plt.show()import matplotlib.pyplot a...原创 2020-04-18 18:55:07 · 156 阅读 · 0 评论 -
runze - 爬取图片
import requestsimport reimport os# wenti = "元气骑士"wenti = input("你想下载什么类型的图片?")if not os.path.exists(wenti): os.mkdir(wenti)url = r'http://image.baidu.com/search/flip?tn=baiduimage&ipn=r...原创 2020-04-11 18:53:24 · 158 阅读 · 0 评论 -
runze - 爬取脑筋急转弯
import requestsimport renum_question = 0for num in range(74): url = "http://www.2345.com/inner/jzw/%d.htm"%num response = requests.get(url) # print(response.text) result = re.findal...原创 2020-04-04 18:49:05 · 150 阅读 · 1 评论 -
runze - 学习爬去天气预报
import easygui as guiimport requestsimport city# inputcityname = gui.enterbox('你想查找哪个城市')chengshi = city.citycode[cityname]url = 'http://t.weather.sojson.com/api/weather/city/'+chengshiresponse...原创 2020-03-28 18:50:07 · 122 阅读 · 0 评论 -
runze -学习网页
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>wanglei</title></head><body><h1>王垒——一位优秀的竞赛教师,<br>曾带出一位国家金牌...原创 2020-03-14 18:52:44 · 1619 阅读 · 1 评论 -
runze -计算器完整版
import mathimport tkinter as tkcal = tk.Tk()cal.title("casio")cal.geometry("280x505")label1 = tk.Label( cal, font=(None, 20), bg="#CDC9C9", fg="black", anchor="n", # 船锚 nor...原创 2020-03-07 18:50:20 · 129 阅读 · 0 评论 -
runze - 计算器
import mathimport tkinter as tkcal=tk.Tk()cal.title("casio")cal.geometry("280x505")label1 = tk.Label( cal, font=(None,20), bg = "#CDC9C9", fg = "black", anchor = "n", # 船锚 no...原创 2020-02-29 18:49:23 · 236 阅读 · 0 评论 -
runze - 完整版qq登陆界面
import tkinter as tkimport tkinter.messageboxqq = tk.Tk()qq.geometry('800x600')qq.title('一只企鹅')user1 = tk.StringVar()user2 = tk.StringVar()def click(win): mimaku = {'1462638662': '000000...原创 2020-02-22 18:46:49 · 265 阅读 · 2 评论 -
runze - qq登录界面
import tkinter as tkwin = tk.Tk()win.geometry("800x500")win.title("qq登陆")# 设置一个变量的内是个字符串uu = tk.StringVar()# 输入 Entrye1 = tk.Entry( win, show="", font=(None,30), textvariable ...原创 2020-02-15 18:48:04 · 225 阅读 · 0 评论 -
runze -学习tkinter
import tkinter as tk# tkinter 用来写用户界面的工具# as 重命名# 1。初始化,新建一个对象myWindow = tk.Tk()# 2.窗口的大小, 通过一个元组给一个宽度和高度()myWindow.geometry("500x500")# 3.软件的标题myWindow.title("元气骑士")a = 0def c...原创 2020-02-08 18:51:42 · 193 阅读 · 1 评论 -
runze -review class
class hero: def run(self): print('run')# 子类class youxia(hero): def __init__(self,name): self.name = name self.youxia = "shopping" self.life = 5 self....原创 2020-02-04 18:45:59 · 203 阅读 · 0 评论 -
runze -class(zombie,bean)
class zombie(): def __init__(self,pn): self.__blood=100 self.name='普通僵尸' self.speed=1 self.damage = 50 self.playerName = pn def gethp(self): pr...原创 2019-12-28 18:49:06 · 105 阅读 · 0 评论 -
Runze -学习time
import time# 本地时间t1 = time.localtime()print(t1)t2 = time.strftime("%Y-%m-%d %H:%M:%S",time.localtime())t2 = time.strftime("%H:%M",time.localtime())print(t2)# wday week of day# 夏令时 规定import ...原创 2019-12-21 18:44:45 · 134 阅读 · 0 评论 -
runze - 用python学习文件操作
# 1。open# 2。构造文件地址C:\Users\jrcode02\Desktop\新建文件夹\text.txt# 读取文件 read write# f = open(r'C:\Users\jrcode02\Desktop\新建文件夹\test.txt','r')# content = f.read()# print(content)# f.close() # 关闭文件# # 写...原创 2019-11-30 18:50:37 · 132 阅读 · 0 评论 -
Runze - python file
import os# 1。查找文件地址 current directory addressaddr = os.getcwd()print(addr)# 2. 新建文件夹 make directory# os.mkdir("皇室战争")# 3。1 跳转文件地址 change directoryos.chdir(r"C:\Users\jrcode01\Desktop"...原创 2019-11-23 18:56:11 · 122 阅读 · 0 评论 -
Runze-接小球游戏
import randomimport pygamefrom pygame import *import time# loading初始化pygame.init() # 1.初始化screen = pygame.display.set_mode((600,500)) # 3.设置窗口大小pygame.display.set_caption("接小球游戏")rect_x, rect...原创 2019-10-19 19:58:06 · 290 阅读 · 0 评论