Skip to content

Tag: python

Getting data from JSON to JS

In the django function, I send data to JS via JSON How do I get price and expirationdate separately in JS? This is what I get in the django function before sending the JSON: If success: As a result, I get: I need to get the price and expirationdate separately. How can this be done? Answer How do I get

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

Trouble converting Javascript source to Python

I’m trying to convert a Javascript function to Python. Most of it was no problem but there’s one statement I’m not sure how to convert: The Python so far is: idk what +() or /./g are for. The complete JS function is: Answer The /./g is a regular expression and the +() coerces a string into a…