1

I need to solve a problem where I parse a csv file via a Python script and generate a new file. I've written the script, but the tricky part is that the file to be handled needs to be uploaded via a browser and the result downloaded likewise. The idea is that it shouldn't require a webserver, it needs to be something like a folder, where you open index.html, upload a file and get a download prompt for the result and I'm looking for the most lightweight solution (I am aware I could do this with Django or Flask, but a whole framework for a tiny tool seems overkill).

This may be a bit confusing, so I'll try to clarify the first hurdle: How do I call a python script from a webpage without setting up any webservices (if possible) or what would be the quickest way to achieve this. The webpage isn't really a webpage, it will never be deployed on a webserver, it's just an interface for the script.

1 Answers1

1

For the upload part you can use requests : How to send a file from a python script

For the download part, do you know the url without having to ask anything to the remote server ? If yes, you can still use requests.

Erwan
  • 1,055
  • 1
  • 12
  • 26
  • This may partially solve my problem. The main problem I have is how to call the script from the browser (via javascript). And I just realized I need more tags and clarification on the question. – Paulius Stundžia Aug 20 '17 at 19:17