Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

80
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda