Transfer csv data from computer to html website to python file

I’m working on a project right now that I finished in python, but I want to upload it to the web. It requires csv inputs, and I’m having trouble transferring the data from the html page I’ve created to the python file. I’m currently using pyscript, and I’ve found out how to convert the contents of the csv file into strings using javascript, but I don’t know how to either call the python function from within a javascript function that gathers all these strings or how to call these javascript functions inside my python file. Any help would be greatly appreciated!

I’ve tried calling the javascript functions in the python file and the python functions in the javascript file, but errors pop up saying the fucntions are undefined. Most likely there’s some syntax I’m missing but I can’t find it for the life of me.