分类: Python

14 篇文章

thumbnail
Python 实现可视化抽奖
代码 from tkinter import * import threading import time root = Tk() root.title('大转盘') root.minsize(300,300) btn1=Button(root,text='樱桃',bg='red') btn1.place(x=20,y=20,width=50,he…
Python 练习册,每天一个小程序,第 0003 题
要求 将 0001 题生成的 200 个激活码(或者优惠券)保存到 Redis 非关系型数据库中。 代码 import random import string import redis re=redis.Redis() print(re.get('mytest')) def getKeys(): list=[] str=string.ascii_…
Python 练习册,每天一个小程序,第 0002 题
要求 将 0001 题生成的 200 个激活码(或者优惠券)保存到 MySQL 关系型数据库中。 代码 import string import random import pymysql db=pymysql.connect(host="localhost", user="root", password="Yuyy0800", db="big_d…
Python 练习册,每天一个小程序,第 0001 题
要求 做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码(或者优惠券),使用 Python 如何生成 200 个激活码(或者优惠券)? 代码 import random import string str=string.ascii_uppercase+string.digits def getKey(length…
thumbnail
Python 练习册,每天一个小程序,第 0000 题
要求  将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果。 类似于图中效果 代码 from PIL import Image, ImageDraw, ImageFont iconPath=r"F:\学习\移动互联APP\APP图标\bf181022.png" icon=Image.open(iconPath…
thumbnail
Python爬取重庆交通大学官网
爬取重庆交通大学官网首页的时政要闻,并提取信息,将时政要闻的时间、标题全部导出显示 代码 import requests from urllib import request from bs4 import BeautifulSoup def main(): url = "http://news.cqjtu.edu.cn/rss.htm" head…
thumbnail
Python处理Json文件
要求 (1)采用iTunes API做个小实验,利用关键词来生成JSON数据结果集。iTunes是由Apple公司提供的一个音乐服务,任何人都可以利用iTunes服务来查找歌曲、艺术家和专辑。在查找的时候需要把搜索关键词添加到iTunes API URL的后面。 URL中,=后面的是搜索关键词,是一个乐队的名字,the Growlers。 注意:U…
thumbnail
Python利用Toshare:给上证50的股票是否值得投资评级
https://yuyy.info/big_data/class_4_Toshare:给上证50的股票是否值得投资评级/实验二_上证50是否值得投资.html 获取上证50股票信息 查看股票业绩报告 选取关键信息 pre_eps,上年同期每股收益 查看获取到的信息 获取全部信息 并和上证50股票信息合并 连接列为股票编码code 提取数据 获取上证5…