Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

78
Views
Run a python script to generate a file that can be downloaded on web

I've been working on this Python script that creates an excel file, but I wanted to be able to distribute the script by creating a website that can run the script and download the file.

  <a href="file:shift.xlsx" target="_blank">
      <h3>Download Schedule</h3>
  </a>

  <input type="button" id='script' name="scriptbutton" value=" Run Script " onclick="goPython()">

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

  <script>

    function goPython() {
      $.ajax({
        alert("Check"),
        type: "POST",
        url: "main.py",
      }).done(function(o) {
        alert("Complete")
      });
    }
  </script>

The python code is as follows:

import xlsxwriter
workbook = xlsxwriter.Workbook('shift.xlsx')
worksheet = workbook.add_worksheet()
worksheet.write(0,0,     "test")
workbook.close()

When I try to download the file it says that it can't be found. Is it possible to do this without Django or Flask? Thanks!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!