I have a python script running in views.py within Django which returns two very large string arrays, x and y. It currently is able to run off a button press within my index.html.

```
def python_file(request):
    final()
    return HttpResponse("ran")

```

The ajax code I have running to do the button press.

```
<script src="http://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>

    <script>
            function gotoPython(){
                $.ajax({
                  url: "/python_file",
                 context: document.body
                }).done(function() {
                 alert('finished python script');
                });
            }
    </script>

```

It's also attached to the URLS.py. I know there's no array being returned right now, because I am unsure how to run the script, get the data simultaneously, then add it to the page without refreshing the page. So, I am asking what would be the best practice to do what I described. Any help would be appreciated.