Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

79
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda