파이썬 파일 관리방법(ft. blueprint 사용)
우선 파이썬의 기본 구조는 다음과 같다.from flask import Flask, render_templateapp = Flask(__name__)@app.route('/')def home(): return render_template('index.html')if __name__ == '__main__': app.run('0.0.0.0', port=4000, debug=True)flask의 내장함수인 render_template을 통해 html파일을 불러와 재생시키는 것이다.그리고 만약 __main__ 구문이 있는 파이썬 파일을 직접 실행했을 때만, port번호 4000으로 실행시키라는 명령어다. 음.. __main__ 관련해선 자세한 건 아래 블로그를 참고하자. 더 자세히 설명할 자신이 없다...
7. 봉드로이드_개발공부
2024. 10. 13. 18:08