I would like to get the position data from the js joystick o use it at the flask server. I tried using ajax: python: @app.route(‘/test’, methods=[‘GET’, ‘POST’]) def test_ajax(): Every time the position of the joystick changed I would like to send the position data to flask Answer You can simply use the callback function to send the joystick data.
Tag: flask
Is there a way to catch socket.io events without JavaScript in Flask?
My application handels a countdown, which refreshes all the time. The countdown itself is handeld by the server, like so: Currently I am catching the event data in JavaScript like this: Q.: Is there a way to catch socket.io events without JavaScript? If so, how could I do this? Answer If you are looking to replace javascript with python within
How to retrieve and save to Blob a binary file video from Flask?
I know few things about video encoding and I encountered an issue that is blocking me for few days. Goal: Record a video from my laptop’s webcam with a VueJS front end application. Send this video to a Python flask app in the backend within a FormData through Axios and Flask. Receive the video in the Flask app. Simply send
How I can send data from Flask to JavaScript?
Hello I am new and building an application in Flask and Javascript. I have a problem with sending data from Flask do JavaScript. I have code in routes.py I want to send jsonify(slownik) to my code in JavaScript but I dont want to do it with render_template bacause it refresh a page and I need this data to display it
How to get input form without reloading from HTML to flask?
I want to retrieve the input of the fields in the form of an array to the flask, on clicking a button, and without reloading the page. All the input fields are dynamic but the input filed id is static. Here, above are the input fields and I want to retrieve the input with the click of the “calculate button”.
Send Wav file from js to flask
I have this code in js witch recod an audio from the browser and I need to send it back from js to flask How I should do that while making the file in wav format? Answer The following example creates a limited time audio recording and uploads it when finished. A form containing a blob is used for this.
Can’t return multiple variables from Flask to Javascript AJAX function
I have a JS function that is updating subsequent select boxes based on the previous input. I am populating these with responses from a Flask function that queries a database. The issue is that the second variable that holds an array cannot be processed properly. The first function works fine, but the second just has an undefinded variable. JS Function
List of list from flask to JS
My Python code calculate coordonates of devices and put it in a list. So i get a list of list in a python var my_devices_list = [ [“name1”, 11.1, 22.2] , [“name2”, 33.3, 44.4] ] i’m trying to pass this list to my JS code my python code : my JS code : the alert I get from the JS
How to integrate python chatbot to a website
I have created a chatbot in python. I have also created a UI in html, css and js and connected the python chatbot to ui using flask. This is how it looks. UI Image How to flow goes is when a user inputs in the chat ui, the content is sent to flask and from flask to python file. The
update elements in electron with python (and flask?)
I am trying to use a python script to update elements on electron. I have read many tutorials but most of them didn’t work and the one that did work I couldn’t understand how to change it to use it in my program. For this reason I have created an electron app that updates a <p> element with javascript and