Last active
July 6, 2018 01:22
-
-
Save umluizlima/3043f14c056d670daa18e28bfc5b2a68 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from subprocess import call | |
from flask import Flask, render_template, send_from_directory | |
app = Flask(__name__) | |
app.route('/') | |
def index(): | |
return render_template('index.html') | |
app.route('/<int:length>') | |
def ruler(length): | |
return send_from_directory( | |
os.path.abspath(os.path.curdir), | |
call(f'dxf-ruler-generator {length}'), | |
as_attachment=True | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment