Skip to content

Instantly share code, notes, and snippets.

# MySQLdbの場合
#
import MySQLdb
connection = MySQLdb.connect(host='192.168.59.103', db='hoge_db', user='hoge_user', passwd='hoge_pw', charset='utf8')
cursor = connection.cursor()
cursor.execute('select * from foo_bar')
result = cursor.fetchall()
for row in result:
print row
cursor.close()
@ojos
ojos / flashpolicyd.py
Last active August 29, 2015 14:13
Simple Flash Socket Policy Server
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import logging
import logging.handlers
import SocketServer
from datetime import datetime as dt
HOST = '0.0.0.0'