libra-gyf

2020年3月12日 #

缺少.dll 处理方法

摘要: 安装vc++运行库,最简单了。。。 阅读全文

posted @ 2020-03-12 22:37 libra-gyf 阅读(125) 评论(0) 推荐(0) 编辑

2020年3月11日 #

vscode _coderunner 中文乱码

摘要: 设置使用 built-in terminal 1) 首先到用户设置中搜索设置Code-runner: Language ID To File Extension Map 点击"在settings.json中编辑" 2)添加如图所示代码, 保存即可 "code-runner.runInTerminal 阅读全文

posted @ 2020-03-11 20:23 libra-gyf 阅读(758) 评论(0) 推荐(1) 编辑

2020年2月6日 #

文件拷贝

摘要: # 复制文件小脚本 source_file = r'D:\py1912\demo\tanchishe.py' target_file = r'D:\py1912\demo\temp.py' # 分别打开文件对象 source = open(source_file,'rb') target = ope 阅读全文

posted @ 2020-02-06 22:38 libra-gyf 阅读(120) 评论(0) 推荐(0) 编辑

2020年2月5日 #

随机发红包

摘要: # 写一个发红包,接受两个参数:金额 个数 import random money = 200 num = 10 ret = random.sample(range(1, money*100),num-1) ret.sort() ret.insert(0,0) ret.append(money*10 阅读全文

posted @ 2020-02-05 17:56 libra-gyf 阅读(164) 评论(0) 推荐(0) 编辑

计算时间差

摘要: # 计算时间差的功能 # 如果是年月日,只显示年月 # 2018-9-3 22:48:20 # 2019-9-4 22:48:20 import time str1 = '2020-2-3 22:48:0' str2 = '2019-9-4 22:48:20' struct_time1 = time 阅读全文

posted @ 2020-02-05 17:00 libra-gyf 阅读(103) 评论(0) 推荐(0) 编辑

2020年1月14日 #

简易狼人杀

摘要: import random import time card = ["预言家", '狼人', '女巫', '猎人', '村民', '狼人', '狼人', '村民', '村民'] identy = random.sample(card, 9) name_1, name_2, name_3, name_ 阅读全文

posted @ 2020-01-14 18:41 libra-gyf 阅读(286) 评论(0) 推荐(0) 编辑

2020年1月11日 #

Github base demo 07

摘要: """ base 07 写函数,计算传入字符串中【数字】、【字母】、【空格] 以及 【其他】的个数 """ def demo(s): d = 0 a = 0 s = 0 e = 0 st = input('输入字符串') for i in st: if i.isdigit() is True: d 阅读全文

posted @ 2020-01-11 13:51 libra-gyf 阅读(99) 评论(0) 推荐(0) 编辑

Github base 05 &三国人物查询

摘要: # 05 用户交互,显示省市县三级联动的选择. dic = { "河北": { "石家庄": ["鹿泉", "藁城", "元氏"], "邯郸": ["永年", "涉县", "磁县"], }, "河南": { "石家庄2": ["鹿泉2", "藁城2", "元氏2"], "邯郸2": ["永 阅读全文

posted @ 2020-01-11 09:58 libra-gyf 阅读(214) 评论(0) 推荐(0) 编辑

2020年1月10日 #

GIthub base 04 购物车

摘要: """ 04 要求用户输入总资产,例如:2000 显示商品列表,让用户根据序号选择商品,加入购物车 购买,如果商品总额大于总资产,提示账户余额不足,否则,购买成功。 附加:可充值、某商品移除购物车 goods = [ {"name": "电脑", "price": 1999}, {"name": " 阅读全文

posted @ 2020-01-10 19:15 libra-gyf 阅读(198) 评论(0) 推荐(0) 编辑

GItHub base 03- 最初级的购物车

摘要: """ 03 输出商品列表,用户输入序号,显示用户选中的商品 li = ["手机", "电脑", '鼠标垫', '游艇'] """ li = ["手机", "电脑", '鼠标垫', '游艇'] cart = [] while True: for i in range(len(li)): print( 阅读全文

posted @ 2020-01-10 15:59 libra-gyf 阅读(130) 评论(0) 推荐(0) 编辑

导航