问题总结
文章平均质量分 67
my2010Sam
这个作者很懒,什么都没留下…
展开
-
ValueError: invalid literal for int() with base 10
Traceback (most recent call last): File "", line 1, in ValueError: invalid literal for int() with base 10: '1.0'如果写int("1.0")就会错误,因为python假设需要进行int转型的字符串仅仅包含数字,这时候用round(float("1.0"))就ok了。转载 2013-12-09 09:12:01 · 65834 阅读 · 0 评论 -
安装pip
linux下安装软件包要用root权限,即sudo apt-get install xxx转载 2014-02-19 09:16:42 · 1082 阅读 · 0 评论 -
解决 WindowsError: [Error 87]
Traceback (most recent call last): File "C:\Users\tomet\Desktop\a.py", line 10, in b = webdriver.Firefox() File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", lin原创 2014-04-09 22:21:08 · 10787 阅读 · 0 评论 -
Pyscripter下载地址及UnicodeEncodeError: 'ascii' codec解决方法
Pyscripter下载地址: http://code.google.com/p/pyscripter/downloads/list(我的电脑是32位操作系统,下载的是:PyScripter-v2.5.3-Setup.exe )Pyscripter报错的解决方法:第一次打开就出错:UnicodeEncodeError: 'ascii' codec can't en转载 2013-01-16 15:41:44 · 6482 阅读 · 2 评论 -
遇到的问题总结
[Error 183] 当文件已存在时,无法创建该文件。原创 2013-10-28 17:21:22 · 960 阅读 · 0 评论 -
Fixing “selenium.common.exceptions.WebDriverException: Message: ‘Can\’t load the profile.”
Fixing “selenium.common.exceptions.WebDriverException: Message: ‘Can\’t load the profile.”Getting such error while using selenium with Python means that you most probably updated Firefox and d转载 2014-01-20 15:28:47 · 8289 阅读 · 0 评论 -
在Ubuntu上安装MySQLdb
想在服务器上需要运行MYSQLDB,sudo apt-get install python-mysqldb,提示安装成功,可是import MySQLdb 提示找不到此模块sudo apt-get source python-mysqldb,想编译一下,总也不成功,总报错,估计是库不全,sudo apt-get install python-all-devsudo apt-转载 2014-01-23 10:58:08 · 2944 阅读 · 0 评论 -
Ubuntu下彻底卸载mysql、安装mysql、及MySQLdb模块
做个记录:1、删除 mysql1 sudo apt-get autoremove --purge mysql-server-5.02 sudo apt-get remove mysql-server3 sudo apt-get autoremove mysql-server4 sudo apt-get remove mysql-common (非常重要)上面转载 2014-01-23 13:49:35 · 11752 阅读 · 0 评论 -
MySQL问题解决:-bash:mysql:command not found
MySQL问题解决:-bash:mysql:command not found 问题: [root@linux115 /]# mysql -uroot -p -bash: mysql: command not found 因为mysql命令的路径在/usr/local/mysql/bin下面,所以你直接使用mysql命令时,系统在转载 2014-01-22 16:00:28 · 38777 阅读 · 4 评论 -
Reading package lists... Error! 解决方案
ubuntu 下安装python开发包,执行命令 sudo apt-get install python-dev,报错;Reading package lists... Error!E: Encountered a section with no Package: headerE: Problem with MergeList /var/lib/apt/lists/AZ.a转载 2014-01-23 09:45:17 · 6671 阅读 · 0 评论 -
全局变量报错:UnboundLocalError: local variable 'l' referenced before assignment
总结:内部函数,不修改全局变量可以访问全局变量内部函数,修改同名全局变量,则python会认为它是一个局部变量在内部函数修改同名全局变量之前调用变量名称(如print sum),则引发Unbound-LocalError在程序中设置的sum属于全局变量,而在函数中没有sum的定义,根据python访问局部变量和全局变量的规则:当搜索一个变量的时候,python先从局部作用域开始转载 2014-01-01 16:35:11 · 104415 阅读 · 3 评论 -
\r \n有什么区别
google找到了这么一段信息:换行符就是另起一行, 回车符就是回到一行的开头,'\n' 10 换行(newline)'\r' 13 回车(return)在windows系统下,回车换行符号 是"\r\n". 但是在Linux等系统下是没有"\r"符号的。在解析文本或其他格式的文件内容时,常常要碰到判定回车换行的地方, 这个时候就要注意既要判定"\r\n"又要判定"\n"。转载 2015-02-25 12:14:05 · 702 阅读 · 0 评论