Python中Sqlite3的: No such file or directory错误
当我把Windows下写好的Python程序传到Linux下运行时,出现: No such file or directory错误,具体出错的语句就是sqlite3.connect("db"),按理说Python的跨平台性应该是没什么问题。
同样的代码,在Linux下写的就能执行。那就该是编码的问题了。解决办法:
假设文件名是test.py,用vi打开它:
vi test.py
然后将其格式改为Unix的,具体执行
:set fileformat=unix :wq
转载请注明:来自pugWoo's Life
本文地址:http://www.pugwoo.com/2010/03/3/python-sqlite3-error.html
19 条评论
我要留言