web-frameworks

How to connect JavaScript to Python script with Flask?

How to connect JavaScript to Python script with Flask? Question: I created a website with HTML/CSS. I also used Javascript for events (click on button, …). Now I want to connect a Python script with it and more importantly, return the results from my Python functions to my website and display (use) them there. Consider …

Total answers: 2

What's the right approach for calling functions after a flask app is run?

What's the right approach for calling functions after a flask app is run? Question: I’m a little confused about how to do something that I thought would be quite simple. I have a simple app written using Flask. It looks something like this: from flask import Flask app = Flask(__name__) def _run_on_start(a_string): print “doing something …

Total answers: 3

How to select random port number in Flask?

How to select random port number in Flask? Question: Using Flask, how can I get the current port number that flask is connected to? I want to start a server on a random port using port 0 but I also need to know which port I am on. Edit I think I’ve found a work …

Total answers: 5

Django vs other Python web frameworks?

Django vs other Python web frameworks? Question: I’ve pretty much tried every Python web framework that exists, and it took me a long time to realize there wasn’t a silver bullet framework, each had its own advantages and disadvantages. I started out with Snakelets and heartily enjoyed being able to control almost everything at a …

Total answers: 13