Skip to content

Instantly share code, notes, and snippets.

View perone's full-sized avatar
🙃

Christian S. Perone perone

🙃
View GitHub Profile
@perone
perone / gist:2938394
Created June 15, 2012 19:45
libxpto ctypes
#!/usr/bin/env python
#-*- encoding: utf-8 -*-
from ctypes import *
iLib = cdll.LoadLibrary('./libXPTO.so')
iLib.getData.argtypes = [ c_char_p, c_char_p ]
iLib.getData.restype = c_int
sInfo = create_string_buffer(1500)
@perone
perone / upload.py
Created April 10, 2012 18:44
Simple flask upload
import os
from flask import Flask, request, url_for
from werkzeug import secure_filename
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def upload_file():
if request.method == 'POST':
file = request.files['file']