i have 2 python scripts:
tnk_flask.py
: creates flask webserver , 2 pages. pitoka.py
: creates random number.
my goal following:
when run pitonka.py
, generate random number i'd pass tnb_flask.py
, but, after refreshing pages nothing changes.
what can mistake?
tnb_flask.py:
from flask import flask # ezzel importáljuk ki pitonka import * app = flask(__name__) @app.route('/') def index(): denis = alma() return str(denis) @app.route('/tuna') def index__(): return str(numbi) if __name__ == "__main__": app.run(debug=true)
pitonka.py:
from flask import flask # import tnb_flask import random numbi = random.randint(10, 100) print(numbi) def alma(): return numbi + 17
in pitonka.py assigning random number variable. random variable once. instead return random number in function.
def alma(): return random.randint(10, 100) + 17
Comments
Post a Comment