上一页 1 ··· 48 49 50 51 52 53 54 55 56 ··· 86 下一页
摘要: from random import random #引入随机库 #提示用户程序的功能和要求 def printIntro(): print("这个程序模拟两个选手A和B的某种竞技比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)") #获得数据 def getInput( 阅读全文
posted @ 2020-05-02 18:07 木子欢儿 阅读(431) 评论(0) 推荐(0)
摘要: 演示地址:http://quickso.cn/ Bing每日壁纸API是一个基于RESTful的API,这里有一个已经部署好的API,此API已经支持HTTPS,可以放心调用。 CSS中设置背景图片 可以使用此API直接在CSS中设置背景图片: background-image: url(https 阅读全文
posted @ 2020-05-01 08:12 木子欢儿 阅读(1404) 评论(0) 推荐(0)
摘要: from bs4 import BeautifulSoup import openpyxl import re import urllib.request import urllib.error # 访问url def ask_url(url): # 伪装浏览器 head = {'User-Agen 阅读全文
posted @ 2020-04-27 13:47 木子欢儿 阅读(647) 评论(0) 推荐(0)
摘要: 2019政府工作报告.txt https://www.lanzous.com/iby44eh 栗子1: import wordcloud import jieba f=open("2019政府工作报告.txt","r",encoding="utf-8") t=f.read() f.close() l 阅读全文
posted @ 2020-04-26 13:21 木子欢儿 阅读(1431) 评论(0) 推荐(0)
摘要: 建议挂梯子安装 栗子1: import wordcloud txt="Life is stort,you need python" c=wordcloud.WordCloud(\ background_color="white") c.generate(txt) c.to_file("1.png") 阅读全文
posted @ 2020-04-26 12:12 木子欢儿 阅读(1301) 评论(0) 推荐(0)
摘要: ls=[[1,2],[3,4],[5,6]]#二维列表 for row in ls: for column in row: print(column) 阅读全文
posted @ 2020-04-26 11:30 木子欢儿 阅读(255) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-04-26 11:08 木子欢儿 阅读(232) 评论(0) 推荐(0)
摘要: 实践 代码: import turtle as t t.title('自动轨迹绘制')#绘制窗口标题栏的标题 t.setup(800,600,0,0)#绘制窗口大小 t.pencolor("red")#画笔颜色 t.pensize(5)#画笔粗细 #数据读取 datals=[]#建立空列表 f=op 阅读全文
posted @ 2020-04-25 17:16 木子欢儿 阅读(1549) 评论(0) 推荐(0)
摘要: 绝对路径和相对路径 写程序要加这个 f=open("D:/MyProject/Python学习/demo.txt","w+") ls=["A","B","C"] f.writelines(ls) f.seek(0)#将指针返回到开头 for line in f: print(line) 阅读全文
posted @ 2020-04-25 17:01 木子欢儿 阅读(198) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-04-25 16:00 木子欢儿 阅读(176) 评论(0) 推荐(0)
上一页 1 ··· 48 49 50 51 52 53 54 55 56 ··· 86 下一页