Python程序debug出错
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python程序debug出错相关的知识,希望对你有一定的参考价值。
各位大侠,我在eclipse下配置了python开发环境,新建了个工程,添加python文件,写了如下代码a =111print ("111");print (a);但是debug的时候出现如下错误,为什么呢?另,run可以的。pydev debugger: startingTraceback (most recent call last): File "D:\360安全浏览器下载\eclipse\plugins\org.python.pydev_3.2.0.201312292215\pysrc\pydevd.py", line 1706, indebugger.run(setup['file'], None, None) File "D:\360安全浏览器下载\eclipse\plugins\org.python.pydev_3.2.0.201312292215\pysrc\pydevd.py", line 1324, in run pydev_imports.execfile(file, globals, locals) #execute the script File "D:\360安全浏览器下载\eclipse\plugins\org.python.pydev_3.2.0.201312292215\pysrc\_pydev_execfile.py", line 34, in execfile contents = stream.read()UnicodeDecodeError: 'gbk' codec can't decode byte 0xb4 in position 22: illegal multibyte sequence
“UnicodeDecodeError”,编码错误;请尝试在py文件开始加上#coding:utf-8,指定编码。
另,这个eclipse最好别放在“360安全浏览器下载”文件夹下。 参考技术A 循环退出主要是这一段代码:
next: inc di //数组下标加1。这一行代码使用next标志
cmp ar[di],0 //比较数组当前元素是不是0
loopz next //如果是0,跳到next这一行继续执行;如果不是0,则继续往下执行
将 XMPP 集成到我的应用程序时出错
【中文标题】将 XMPP 集成到我的应用程序时出错【英文标题】:error when integrating with XMPP into my application 【发布时间】:2011-03-26 05:26:56 【问题描述】:当我将 XMPP 集成到我的应用程序中时,我遇到了一个错误。请帮我解决这个问题:
Build CheckOut of project CheckOut with configuration Debug
Ld build/Debug-iphonesimulator/CheckOut.app/CheckOut normal i386
cd "/Users/stellentmac1/Desktop/CheckOut 2"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk "-L/Users/stellentmac1/Desktop/CheckOut 2/build/Debug-iphonesimulator" "-L/Users/stellentmac1/Desktop/CheckOut 2/../../../../../xmppframework/Vendor/libidn" "-L/Users/stellentmac1/Desktop/CheckOut 2" "-F/Users/stellentmac1/Desktop/CheckOut 2/build/Debug-iphonesimulator" -filelist "/Users/stellentmac1/Desktop/CheckOut 2/build/CheckOut.build/Debug-iphonesimulator/CheckOut.build/Objects-normal/i386/CheckOut.LinkFileList" -mmacosx-version-min=10.6 -lxml2 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics -framework CFNetwork -framework MobileCoreServices -framework SystemConfiguration -lz.1.2.3 -lresolv -o "/Users/stellentmac1/Desktop/CheckOut 2/build/Debug-iphonesimulator/CheckOut.app/CheckOut"
ld: warning: directory '/Users/stellentmac1/Desktop/CheckOut 2/../../../../../xmppframework/Vendor/libidn' following -L not found
ld: duplicate symbol _kRFSRVResolverErrorDomain in /Users/stellentmac1/Desktop/CheckOut 2/build/CheckOut.build/Debug-iphonesimulator/CheckOut.build/Objects-normal/i386/RFSRVResolver-1A90E36B7A8C9E67.o and /Users/stellentmac1/Desktop/CheckOut 2/build/CheckOut.build/Debug-iphonesimulator/CheckOut.build/Objects-normal/i386/RFSRVResolver-7299ADCEDF231192.o
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
【问题讨论】:
【参考方案1】:这看起来像是由于对框架的使用不够谨慎而导致的链接问题。
您是否有一个 xmppframework 的副本链接和您项目中包含的源代码,或者您的项目中包含的源代码的两个副本?
【讨论】:
以上是关于Python程序debug出错的主要内容,如果未能解决你的问题,请参考以下文章