Sending data from a Javascript program to a Python program and vice versa

I’m working on a project where data gathered from a Javascript program can be treated in a python program since many libraries in python are absent in Javascript. I’m currently trying to use Ajax to send the data between the .js file and the .py file

    $.ajax({
      type: "POST",
      url: "/Users/ryancheng/Desktop/coding/dashathon2021/dasha-app/webscrape.py",
      data: {param:restResult.data.features},
      success: function(response){
        output = response;
        alert(output);
      }
    }).done(function(data){
      console.log(data);
      alert(data);
    })

However I get the error ReferenceError: $ is not defined. Any help would be much appreciated. If there is any other method to send files back and forth that I am not aware of, please let me know.