python问题汇总

来源:互联网 发布:知乎发帖被删 编辑:程序博客网 时间:2024/06/13 13:32

解决中文编码

在程序开头加上,
# coding: utf-8 or ### -*- codi -*- codi -*- coding: utf-8 -*-


安装psycopg2模块

psycopg2模块用来支持python连接PostgreSQL,安装代码如下:

yum install postgresql-libsyum install python-setuptoolsyum -y install python-psycopg2 

ubuntu下执行sudo apt-get install python-psycopg2即可。

1 0
原创粉丝点击