我在看<父与子的编程之旅>的时候,有段代码是随机画100个矩形,矩形的大小,线条的粗细,颜色都是随机的,代码如下, import pygame,sys,random from pygame.color import THECOLORS pygame.init() screen = pygame.display.set_mode([640,480]) screen.fill([255,255,255]) for i in range(100): width = random.randint(0,…
今天在学习使用HTMLTestRunner生成测试报告时遇到一个报错,如图所示: 网上搜索了下“No module named 'StringIO'”解决方法,原来我用的是Python 3.X版本,而下载的HTMLTestRunner适用于Python2.X(下载链接:http://tungwaiyip.info/software/HTMLTestRunner.html) 于是这里再做次“搬运工”,了解下如何在Python3中使用HTMLTestRunner报No module named 'S…
#########sample########## sqlite3.OperationalError: Could not decode to UTF-8 column 'logtype' with text 将 with connection.cursor() as c: c.execute("select id,name from district_info where p_id=0") provinces = c.fetchall() 调整为 con = sqlite3.conn…