Skip to content

Instantly share code, notes, and snippets.

Avatar

M Hazwan hazxone

  • Datafyt
  • Malaysia
View GitHub Profile
@hazxone
hazxone / remove_comments.py
Created Aug 29, 2019 — forked from BroHui/remove_comments.py
Remove comments and docstrings from a python fille.
View remove_comments.py
""" Strip comments and docstrings from a file.
"""
import sys, token, tokenize
def do_file(fname):
""" Run on just one file.
"""
source = open(fname)
@hazxone
hazxone / upload.py
Created Dec 7, 2018
Flask Simple Upload File
View upload.py
import os
from flask import Flask, request, redirect, url_for
UPLOAD_FOLDER = ''
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
@app.route('/', methods=['GET', 'POST'])
def upload_file():
You can’t perform that action at this time.