![]() ![]() ![]() Value = ''.join(random.choices(string.ascii_letters + string.digits, k=1))įLASK APP: from flask import Flask, render_template, Response Obviously this is not "art for art's sake" but rather => I've got a larger script that could benefit from this simplification: displaying the values generated by the external script within the flask app using AJAX. Display the values generated through EXTERNAL PYTHON SCRIPT in FLASK APP one under the next one as they come.And after many, MANY tries => can't get it to work on the website while values are definitely available because I can see them in the terminal when running the same Flask app. HTML FILE: with AJAX to refresh whatever was generated through FLASK APP / EXTERNAL PYTHON SCRIPT every 1 second. ![]() FLASK APP: with a route to run the above EXTERNAL PYTHON SCRIPT using PIPE.Subprocess and getting the values from it using stdout (plus - for testing - I'm also getting the same values printed in the terminal so I know this part works).EXTERNAL PYTHON SCRIPT: Generating random alphanumeric every 5 to 10 seconds.I've got a Flask app with 3 files (code will be at the end of this post): My first question after signing up to StackOverflow and trying many things. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |