편집 기록

편집 기록
  • 프로필 nowp님의 편집
    날짜2021.07.12

    python, html, flask 질문!!!!


    라즈베리4 파이썬에서 미세먼지센서를 작동시켰습니다.

    @app.route("/", methods=["GET"])
    def test():
        dustdata = 'dust3()'
        return render_template("index.html", dusthtml=dustdata)
    
    if __name__ == "__main__":
        app.run(host="0.0.0.0")
    

    html에서 어떻게 바꿔야 저 dust3()라는 함수의 값을 html에 넘겨줄수 있나요?

    <DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8">
        <title>dust test</title>
        <meta http-equiv="refresh" content="3">
    </head>
    <body>
        <div class="container">
            <div class="header">
                dust= {[dusthtml]};
            </div>
        </div>
    </body>
    </html>
    

    원하는 작동은 dust = ????라고 뜨는것입니다.

    이미지

    어떻게 해야 dust값을 파이썬에서 가져올수가있나요? 부탁드립니다.

  • 프로필 알 수 없는 사용자님의 편집
    날짜2021.07.12

    python, html, flask 질문!!!!


    1. 라즈베리4 파이썬에서 미세먼지센서를 작동시켰습니다. 이미지
    2. html에서 어떻게 바꿔야 저 dust3()라는 함수의 값을 html에 넘겨줄수 있나요???이미지
    3. 원하는 작동은 dust = ????라고 뜨는것입니다.... 이미지
    4. 어떻게 해야 dust값을 파이썬에서 가져올수가있나요?...부탁드립니다...