sudo apt-get install python3-pip
sudo pip3 install virtualenv
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from flask import Flask, stream_with_context, request, Response, flash | |
from time import sleep | |
app = Flask(__name__) | |
def stream_template(template_name, **context): |
#Add shortcut to Application menu in Linux Mint
Example will be setting up VS Code on Mint and add shortcut to menu and panel.
Actually, it is really easy, you can just download ir from website, unzip in desired folder and run from there, so this is just about a way to add shourtcut where you want it.
##Download
def add_cors_headers(response): | |
response.headers['Access-Control-Allow-Origin'] = '*' | |
if request.method == 'OPTIONS': | |
response.headers['Access-Control-Allow-Methods'] = 'DELETE, GET, POST, PUT' | |
headers = request.headers.get('Access-Control-Request-Headers') | |
if headers: | |
response.headers['Access-Control-Allow-Headers'] = headers | |
return response | |
app.after_request(add_cors_headers) |