src/pycurl.h:4:20: fatal error: Python.h: No such file or directory
해당 오류 발생하면
apt-get install python3-dev
설치해주고
pip3 install pycurl
다시 해본다.
- Posted
- Filed under 프로그래밍/Python
if type(val) is dict: if 'T' in obj: if 'response' not in jsonData.keys(): if not token: if token['userid'] is None:
if 'response' not in jsonData.keys():
except pycurl.error as e: print(e)
# dict 형태로 row를 반환
cursor = db.cursor(pymysql.cursors.DictCursor)
cursor.execute("SELECT id, name FROM `table`")
rows=cursor.fetchall()
cursor.execute("SELECT id, name FROM `table`")
for i in xrange(cursor.rowcount):
id, name = cursor.fetchone()
print id, name
cursor.execute("SELECT id, name FROM `table`")
result = cursor.fetchmany()
while result:
for id, name in result:
print id, name
result = cursor.fetchmany()
cursor.execute("SELECT id, name FROM `table`")
for id, name in cursor.fetchall():
print id, name
import MySQLdb
conn = MySQLdb.connect(user="user", passwd="password", db="mydb")
cur = conn.cursor()
print "Executing query"
cur.execute("SELECT * FROM bigtable");
print "Starting loop"
row = cur.fetchone()
while row is not None:
print ", ".join([str(c) for c in row])
row = cur.fetchone()
cur.close()
conn.close()