![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python学习
nownow_
Good good study
展开
-
PyCharm中文设置——无需汉化包
设置好后重启即可原创 2021-07-22 18:00:36 · 359 阅读 · 0 评论 -
for/while傻傻分不清楚
总是搞不清如何执行语句,特此输出例子,记录一下for语句执行会依次从0-9,即0,1,2,3,4,5,6,7,8,9挨个执行一次第一个例子:for i = 0 1 2 3 4 5 6 7 8 9 print i= 0 1 2 3 4 5 6 7 8 9 i+2= 2 3 4 5 6 7 8 9 10 11..原创 2020-08-19 18:35:34 · 121 阅读 · 0 评论 -
小甲鱼练习题16
哎呀呀,现在的小屁孩太调皮了,邻居家的孩子淘气,把小甲鱼刚写好的代码画了个图案,麻烦各位鱼油恢复下啊,另外这家伙画的是神马吗?怎么那么眼熟啊!??答案name = input('请输入待查找的用户名:')score = [['迷途', 85], ['黑夜', 80], ['小布丁', 65], ['福禄娃娃', 95], ['怡静', 90]]IsFind = False #定义一个变量,作为标记/ 赋值一个布尔变量for each in score: #遍历列表 if ...原创 2020-08-19 18:16:17 · 503 阅读 · 0 评论 -
UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa7 in position 57: illegal multibyte sequence
在运行python代码时,提示问题:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa7 in position 57: illegal multibyte sequence解决思路:由于代码是复制粘贴的,所以无需考虑代码编写的错误问题。1、编码格式问题把代码进行格式转换,由于默认已经时UTF-8了,索性又转换了两次,没奏效,没能解决问题2、有中文字符把原有代码删除,调成英文下输入后,把代码又复制粘贴,解决了问题。原创 2020-07-08 15:12:40 · 6563 阅读 · 0 评论 -
吐吐槽~关于python环境
早上开机,打开python IDLE, 突然没有了任何反应。由于我的电脑中有python2.7.16和python 3.6.6还有python3.4.0.挨个试试,挨个都不好用!!!在网上查了一些资料,可能是2和3版本不兼容,于是卸载。之后我发现这个口子,越撕越大!接着一系列的问题等着我!折腾了3天,崩溃的边缘。虽说不是什么大的技术问题,但是耗时折磨人呀。同时我又太白了,超级白,基本完全不...原创 2020-04-25 15:19:45 · 200 阅读 · 0 评论 -
python卸载不了
there is a problem with this windows installer package.A programe run as part of the setupdid not finish as expected.Contact your support personnel or package vendor.今天在卸载Python的时候出现了这个问题。按照网上的很多方法,...原创 2020-04-23 22:44:36 · 2991 阅读 · 0 评论 -
python关于 同行以及换行 显示
print("hi"+"there")>> hithereprint("hi","there")>> hi thereprint("hi\nthere")>> hithereprint("hi\there")>> hithereprint默认以换行符\n作为结尾,end=" "则使print以空格字符作为结尾for i in range(5):print (i)>>0...原创 2020-08-12 15:36:10 · 887 阅读 · 0 评论 -
与孩子一起学编程_16.5-16.10
16-5显示图片#16-11import pygame,syspygame.init()screen=pygame.display.set_mode([640,840])screen.fill([255,255,255]) #用白色背景填充窗口my_ball=pygame.image.load(r"F:\\pythonstudy\\ball.jpg") #加载图像,也可以直接给路径,前别忘了r,路径别忘了双\screen.blit(my_ball,[50,50]) # 块移到位置距窗原创 2020-07-09 15:47:43 · 202 阅读 · 0 评论 -
AttributeError: ‘dict‘ object has no attribute ‘key‘
与孩子一起学编程16-7 用原书代码运行,提示 AttributeError: 'dict' object has no attribute 'key'查了百度后,原因是原书是基于2.7版本,而我用的是python3.6.问题出在 color_name=random.choice(lTHECOLORS.keys()) 这是原书的源代码应该更改为:color_name=random.choice(list(THECOLORS.keys()))理由是: 在python2中,key()方...原创 2020-07-09 14:38:25 · 11215 阅读 · 1 评论 -
easygui安装后不能用 module 'easygui' has no attribute 'msgbox'
下载easygui :Download easygui from SourceForge.nethttps://sourceforge.net/projects/easygui/files/latest/download将easygui .py拷贝到python的安装路径,终于import easygui的时候不报错了接着操作,就出现了下面的情况,输入的东西不能显示。提示 At...原创 2020-04-30 15:47:16 · 2393 阅读 · 0 评论