Skip to content

Instantly share code, notes, and snippets.

@ojos
ojos / settings.json
Created October 10, 2024 09:22
vscode python開発環境用
{
"terminal.integrated.scrollback": 100000000,
// "editor.defaultFormatter": "esbenp.prettier-vscode",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"terminal.integrated.env.linux": {
"PATH": "/workspaces/bin:${env:PATH}"
},
"editor.renderWhitespace": "all",
"python.defaultInterpreterPath": "/usr/local/bin/python",
# 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'