python是什么 出现这个错误是什么原因

python 引发异常《简明python教程》里的程序,在windows下运行出现了问题,请问应该怎么修改啊?_百度知道
python 引发异常《简明python教程》里的程序,在windows下运行出现了问题,请问应该怎么修改啊?
length&nbsp:&&#39;on&was&\nWhy&=&&#39.jpg" target="_blank" title="点击查看大图" class="ikqb_img_alink"><img class="ikqb_img" src="raw_input(&#39.EOF&Enter& def&A&/zhidao/wh%3D450%2C600/sign=09bc296ab90e7bec238f0be51a1e950e/b3fbafd6:&exception&&&#39#;&<a href=" &nbsp:&Other& & &&nbsp://a;you&nbsp,& &atleast),&=& &nbsp!/usr/bin/python#&nbsp.&#39; &ShortInputE print&did&nbsp://a.atleast& &/zhidao/pic/item/b3fbafd6; &nbsp.length&length.length& self.__init__(self)& s&nbsp:&user-defined& &work&EOFEsomething&nbsp.\&&#39;do&at&nbsp://a.3; print&x,&continue&&#39;%& & #&exception& & raise&nbsp.atleast) if& &least&nbsp,&ShortInputException(len(s);=&x,&expecting&nbsp,&&)&nbsp.&#39;&nbsp:&(x;of& & &as& & &#39;usual&nbsp.pyclass&%d&#39:&__init__( was& & &input&F Ewas& &len(s)&nbsp:& &&#39;can&nbsp. print&nbsp:&%d; &hereexcept&nbsp.--&gt:& &nbsp?&#39; & &nbsp.jpg" esrc=" &3)&No&&#39;an&/zhidao/wh%3D600%2C800/sign=1e60ab997dd98d0f166d224f4afd6;ShortInputEThe&nbsp.ShortInputException(Exception);&#39;class
提问者采纳
序是在Enter something--&提示后输入&gt,asd这些;&&gt,要重新输入得重新运行一遍程序不要在&&gt,&后面输入,ab
提问者评价
是哦,呵呵···谢谢啦
其他类似问题
22人觉得有用
您可能关注的推广
python的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁1)">1)">1" ng-class="{current:{{currentPage==page}}}" ng-repeat="page in pages"><li class='page' ng-if="(endIndex<li class='page next' ng-if="(currentPage
相关文章阅读python tkinter gui库 问题 gif的图片不能显示 高手帮我看看出错在哪里?
python tkinter gui库 问题 gif的图片不能显示 高手帮我看看出错在哪里?
补充:为什么下面的代码放到s函数里运行正常,但为什么不显示图片?:
from Tkinter import *root = Tk()cv = Canvas(root,bg = 'white')def s():&&& img = PhotoImage(file = 'c:\\python.gif')&&&&&&& cv.create_image((150,150),image = img)&&& cv.pack()&&& print '0k's()root.mainloop()下面的代码运行正常可以显示图片:为什么放到函数里就不显示图片了呢?哪里的问题?
from Tkinter import *root = Tk()cv = Canvas(root,bg = 'white')img = PhotoImage(file = 'c:\\python.gif')f=imgcv.create_image((150,150),image = f)cv.pack()root.mainloop()
个人见解:好像是 img = PhotoImage(file = 'c:\\python.gif')定义在函数内部,函数运行结束后就自动释放了,因此没有了img对象,可以把img设成全局变量就可以显示出来。
google了一下,据说是tk的PhotoImage存在BUG,没有给引用的img计数增加,导致如果别处没有引用的话,会被回收。所以可以通过定义成全局变量等方法,暂时使用
的感言:谢谢你帮了我大忙!
相关知识等待您来回答
多媒体领域专家我的MAC OS 上装的python好像有问题,懂的朋友看一下这是什么问题?_百度知道
我的MAC OS 上装的python好像有问题,懂的朋友看一下这是什么问题?
7&#47;python2;python2;Frameworks&#47;2;lib&#47.7&#47.ps1#python2;System&#47.framework&#47.7&#47;Versions&#47;Versions&#47.pyc matches &#47;Library&#47.framework&#47.pyc# &#47.exc_type;lib&#47.py;lib&#47.7&#47;Library&#47,但又不像报错;PPVersions&#47,才出现这种 问题;Library&#47;genericpath.7&#47。;lib&#47;Python打开终端._#python2.framework&#47,请达人解答一下谢谢,# &#47.framework&#47.ps2# clear sys.pyimport genericpath # precompiled from &#47.7&#47.exitfunc#System&#47;python2;Frameworks&#47.7&#47;Frameworks&#47: 20 unfreed ints
我最近清理过一些语言包.7&#47;Python..;2,会出现以下的这些东西.;System&#47。#Library&#47. 等等很多然后 退出python命令行时(exit())会出现;Library&#47;warnings.argv#Frameworks&#47.framework&#47;Versions&#47;2.7&#47.path# clear sys.pyc matches &#47;2;System&#47。;Frameworks&#47。好像在加载一些库;Versions&#47;lib&#47;2.7&#47;warnings:# clear __builtin__;System&#47,以前不会的;Python,但有需要用到,键入python -v 查看版本时,我对python不是很懂.stderr# cleanup __main__# cleanup[1] encodings# cleanup[1] site# cleanup[1] sysconfig# cleanup[1] abc# cleanup[1] _weakrefset# cleanup[1] sre_constants# cleanup[2] os# cleanup sys# cleanup __builtin__# cleanup ints
提问者采纳
-v代表verbose, compressed=48 -&gt.txt (in=48) (out=48) (stored 0%)total bytes=48,会打印出更&quot.txt会显示啰嗦&quot.txt只会显示
adding.txt (stored 0%)而zip -v test:的信息。比如zip test.zip test: test.zip test--version才是最常用的查版本的参数
提问者评价
其他类似问题
python的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁python 出现这个错误是什么原因_百度知道
python 出现这个错误是什么原因
提问者采纳
python 出现这个错误的原因是你没把代码写对
其他类似问题
按默认排序
其他2条回答
0)我们采用第三种方法, &#39;;w&#39.c中设置的IO缓冲类型其实对之后执行的pyth,那我们想改变pyth.fileno().stdout.stdout.py中;,添加 sys.py是无效的.stdout = os,在pyth.stdout = os.py的IO缓冲类型应该怎么做呢;w&#39, &#39:(1) 对python加-u参数(2) 加 PYTHONUNBUFFERED环境变量(3)
sys?很简单.fdopen(sys.py中设置就可以了.fileno()。Python中设置标准输出为无缓冲有以下三种方法.fdopen(sys, 0)到pyth所以之前我们在tcpServer
错误呢?把错误贴出来啊,这我怎么帮你解决啊?
python的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁}

我要回帖

更多关于 python是什么意思 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信