Skip to content

Instantly share code, notes, and snippets.

View hatpub's full-sized avatar
๐ŸŽฏ
Focusing

hatpub

๐ŸŽฏ
Focusing
View GitHub Profile
import os
def mais():
...
if __name__ == "__main__":
main()
os.execl(sys.executable, sys.executable, *sys.argv)
@hatpub
hatpub / file_upload.py
Created March 10, 2020 10:44
file_upload_to_python
from flask import Flask, render_template, request
from werkzeug.utils import secure_filename
app = Flask(__name__)
@app.route('/')
def render_file():
return render_template('upload.html')
@app.route('/fileUpload', methods = ['GET', 'POST'])
@hatpub
hatpub / upload.html
Created March 10, 2020 10:49
upload html form
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
</head>
<body>
<div style="width:80%;text-align:center;margin:30px auto;">
<form action = "http://192.168.0.112:8000/fileUpload" method = "POST" enctype = "multipart/form-data">
<input style="width:80%;padding-bottom:20px;height:22%" multiple="multiple" type = "file" name = "filename[]" />
<input style="width:80%;height:10%" type = "submit" />
</form>
@hatpub
hatpub / docker-compose.yml
Created April 22, 2020 16:16
docker-compose_yml_file
version: '3.3'
services:
webserver:
# dockerfile ์„ ์‹คํ–‰ํ•˜๊ฒ ๋‹ค๋Š” . ๋งŒ์•ฝ ํ•˜์œ„ ํด๋” ์•ˆ์— ์žˆ๋‹ค๋ฉด ํด๋”๊ฒฝ๋กœ ์จ์ค„ ๊ฒƒ
build: .
# docker port ๋Š” 80 localhost port ๋Š” 9001 ์‚ฌ์šฉ ํ•˜๊ฒ ๋‹ค๋Š” ์˜๋ฏธ
ports:
- "9001:80"
links:
@hatpub
hatpub / plotly_stockchart.py
Last active June 9, 2020 17:56
python plotly, dash stockchart
import plotly.graph_objects as go
import dash
import pymysql
import dash_core_components as dcc
import dash_html_components as html
# DB connect
def db_con():
db = pymysql.connect(
host='localhost',