環境
PC : Mac
開発環境 : Visual Studio Code
まずはローカルでhello worldを動かす
flaskをインストール
pip install flask
実行
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return '''
<html>
<body>
<h1>hello world</h1>
</body>
</html>
'''
if __name__ == '__main__':
app.run()
ブラウザで確認
http://127.0.0.1:5000/
非エンジニアに渡して使ってもらえるように、実行ファイル化してみる
実行ファイル化用パッケージをインストール
pip install pyinstaller
実行ファイル化
pyinstaller flask_test.py --onefile
問題なくMac用の実行ファイルを作れた
ちなみに、クロスコンパイラではないのでMacでWindows用の実行ファイルを作ることは出来ないらしい