随笔分类 - python
摘要:python的zip方法zip(attr_key, attr_val)zip() 函数用于将可迭代的对象作为参数,将对象中对应的元素打包成一个个元组,然后返回由这些元组组成的列表。 如果各个迭代器的元素个数不一致,则返回列表长度与最短的对象相同,利用 * 号操作符,可以将元组解压为列表。>>>a =
阅读全文
摘要:极其有可能你把一组dict,用逗号相隔了例如{“id”,id}应该为{“id”:id}
阅读全文
摘要:原因是由于python基于ASCII处理字符的,当出现不属于ASCII的字符时,会出现错误信息解决方法:指定文件字符集为utf-8 在文件头部加入以下代码:
阅读全文
摘要:RuntimeError: The session is unavailable because no secret key was set. Set the secret_key on the application to something unique and secret. 解决办法是 se
阅读全文
摘要:urllib2发生报错URLError: <urlopen error [Errno 10061]:首先检查网址是否正确其次如果报这种错误,是因为ie里设置了代理,取消即可, 步骤: 打开IE浏览器 点击右上角齿轮图标 选择【Internet 选项】 切换到【连接】 删除代理设置即可
阅读全文
摘要:UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html5lib"). This usually isn't a proble
阅读全文

浙公网安备 33010602011771号