Send a Python dictionary to JavaScript / HTML with simple JSON

Опубликовано: 25 Октябрь 2024
на канале: Andrew
8,419
100

UPDATE: A sequel of this video (so to speak) can be found here: [   • Pull data from a remote JSON dictiona...  ]. In that newer video, a JSON dictionary may also be made with Python with the algorithm I show here.

THIS VIDEO: A thought experiment on how to move data generated from Python code to an html /web-compatible form. Dictionaries are very translatable objects. This exercise basically generates a python array, converts it to a stringified JSON, makes a JavaScript file which parses the stringified JSON to a JSON object, and displays the processed data with html code.
In this basic exercise, the tasks are achieved WITHOUT the use of jQuery or Ajax