摘要: 代码如下: 1 import random 2 3 n = int(input("请输入行:")) 4 m = int(input("请输入列:")) 5 x = y = 0 6 while x < n: 7 y = 0 8 while y < m: 9 ... 阅读原文
2020-03-12 10:49:15 阅读(2589) 评论(0)
摘要: 代码如下: 1 import random 2 3 n = 0 4 sum = 0 5 while n < 10: 6 num = random.randint(1, 100) 7 sum = sum + num 8 n += 1 9 print(n... 阅读原文
2020-03-12 10:06:10 阅读(2186) 评论(0)
摘要: 1 x = float(input("请输入横坐标:")) 2 y = float(input("请输入纵坐标:")) 3 if x > 0 and y > 0: 4 print("该点在第一象限") 5 elif x < 0 and y > 0: 6 p... 阅读原文
2020-03-12 08:42:01 阅读(2458) 评论(0)
摘要: 代码如下: 1 for a in range(1, 10): 2 for b in range(1, 10): 3 if b <= a: 4 print("%d*%d=%d\t" % (b, a, a * b), end="") 5 print(... 阅读原文
2020-03-12 08:18:02 阅读(2677) 评论(0)
摘要: import randomnum = random.randint(1, 100)n = 1while n <= 5: guess = int(input("请输入一个数:")) if guess > num: print("对不起,你输入的数太大了") elif ... 阅读原文
2020-03-12 07:38:01 阅读(2288) 评论(0)
摘要: score = float(input("请输入你的成绩:"))if 90 <= score <= 100: print("你的成绩为A档")elif 80 <= score < 90: print("你的成绩为B档")elif 70 <= score < 80... 阅读原文
2020-03-12 06:44:01 阅读(2463) 评论(0)
摘要: 原因:使用peewee创建表时,有类似于这样的语句: field_name = CharField(primary_key=True)(也就是把char类型的字段设置成了主键。) 解释:utf8mb4 编码下 1 char = 4 bytes。而varchar默认长度为255(255*4 = 1020),超过... 阅读原文
2020-03-12 06:10:02 阅读(2317) 评论(0)
摘要: Android设备,比如车载tbox搭载的Android系统, 其只有500M的磁盘容量;电视机搭载的Android系统其磁盘容量也非常小, 一般debug阶段的产品,开启的log比较多,比如有: 自动后台logcat截取,自动捕捉coredump, tombstone,anr, dropbox等crash... 阅读原文
2020-03-12 06:07:02 阅读(2313) 评论(0)
摘要: Android设备,比如车载系统实车路试过程中, 车上操作电脑比较麻烦,如果车载系统出现了Bug, 如何很方便地一次性导出相关的log来(logcat, dbus, 高德地图log,gps定位log等)来呢? 其实我们只需要一个python脚本就可以搞定! 准备阶段 adb pull 命令, 可以把A... 阅读原文
2020-03-12 06:00:20 阅读(2321) 评论(0)
摘要: 起因 一天,我要装一个新的比较大的Python库,看着别人写的教程,先升级一下pip。他写的是: pip install --upgrade pip 没有认真思考,头脑一热,复制粘贴执行,悲剧发生了。 问题 执行该命令后,装了几个文件后,马上报出权限不足问题。这时我一想,这条命令当然有问题:使用pip自己更新... 阅读原文
2020-03-12 00:49:02 阅读(2925) 评论(0)