运行出现如下错误 uncode编码警告:在unicode等价比较中,把两个参数同时转换为unicode编码失败.中断并认为他们不相等. windows下的字符串str默认编码是ascii,而python编码是utf8 解决方法:添加如下几行代码 import sys reload(sys) sys.setdefaultencoding('utf8') 该解决方法同样适用于如下报错 ascii' codec can't decode byte 0xe6 in position 31: ordina…
1. 程序源代码报错部分: #选择年级if grade == '幼升小': outline.nianji().pop(0).click()elif grade == "一年级": outline.nianji().pop(1).click() # 一年级elif grade == "二年级": outline.nianji().pop(2).click() # 二年级elif grade == "三年级": outline.nianji().po…
当字符串比较中有中文时,需要在中文字符串前加 u  转为unicode编码才可以正常比较. str == u"中文"…
在中文字符串前面加u. Make sure your code is in UTF-8 (NOT Latin-1) and/or use a coding line as so: #! /usr/bin/python # -*- coding: utf-8 -*- a = {"a": u"çö"} b = "çö" assert b == a['a'] assert b.decode('utf-8') == a['a'].decode('utf-…
在火狐浏览器33版本,python2.7运行selenium webdriver api报错:SessionNotCreatedException: Message: Unable to find a matching set of capabilities 网上搜了一下,说可以升级浏览器版本到52以上,我升级到了55版本,没有报错了 解决办法:Update Firefox to version >= 52.0.3,更新Firefox版本52.0.3以上 可能也与geckodriver的版本有关…
在 mkfs.ext4 /dev/sda2 格式化硬盘空间时,可能出现这种错误. had this situation at office where I was told to re-partition an already existing partition. The situation was to get the below schema /dev/sdb1 1 3040 24418768+ 83 Linux /dev/sdb2 3041 6080 24418800 83 Linux…
运行easy_install安装python相关程序时提示failed to create process,因为安装了两个python,卸载了的那个目录没删除,删除了另外的python目录后这个问题就解决了…
nginx部署网站后,访问域名,网页显示  500 Internal Server Error ,经查看发现nginx的error.log中有报错: failed (1113: No mapping for the Unicode character exists in the target multi-byte code page), client: 127.0.0.1... 但是其他部署的网站又没有问题,根据字眼Unicode character猜测是中文路径的问题,修改后再次访问,成功.…
Xhprof在windows下点击[View Full Callgraph]调用graphviz软件时.警告Warning: proc_open() [function.proc-open]: CreateProcess failed, error code – 0 in并提示failed to execute cmd " D:/graphviz-2.38/release/bin/dot -Tpng" 位置是xhprof_lib/utils/callgraph_utils.php文件下…
在划分磁盘分区时,遇到错误"WARNING: Re-reading the partition table failed with error 22: Invalid argument" 如下所示: [root@DB-Server u02]# fdisk -l   Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16…