Skip to content

Instantly share code, notes, and snippets.

View akmsg's full-sized avatar

Anand Kumar Mishra akmsg

View GitHub Profile
@akmsg
akmsg / dict2xml.py
Created November 15, 2016 11:17 — forked from reimund/dict2xml.py
Simple dictionary to xml serializer.
"""
Simple xml serializer.
@author Reimund Trost 2013
Example:
mydict = {
'name': 'The Andersson\'s',
'size': 4,
@akmsg
akmsg / send_file_partial.py
Created November 8, 2016 07:35 — forked from lizhiwei/send_file_partial.py
HTTP 206 (Partial Content) For Flask
import mimetypes
import os
import re
from flask import request, send_file, Response
@app.after_request
def after_request(response):
response.headers.add('Accept-Ranges', 'bytes')
return response