0

I want to create a webserver on linux in python so that I can use it to get csv files from the linux machine onto a windows machine. I am quite unfamiliar with networking terminology so I would greatly appreciate it if the answer is a little detailed. I dont want to create a website, just the webserver to get the csv file requested.

2 Answers2

1

If you have the files on disk and just want to serve them over HTTP you can use python's built in modules:

python3 -m http.server

in python 3.x

or

python -m SimpleHTTPServer

For python 2.x.

If you need something more dynamic check out Flask

patonw
  • 81
  • 4
  • Almost forgot. If this is a one off event you should consider using scp via something like [winscp](https://winscp.net/eng/index.php) or sftp instead of creating a server. If you're using ssh to connect to your linux box it probably can act as as an scp/sftp server. – patonw Aug 14 '19 at 03:16
  • You can use the [edit](https://stackoverflow.com/posts/57485721/edit) link under your post to update it with additional info. – Gino Mempin Aug 14 '19 at 06:16
0

You can create an simple file server, using flask, django or any other python web-server frameworks. There are just some small tips:

  1. You should send csv files through HTTP POST request to web-server. I think multi-part/form-data is appropriate for this.
  2. An small/simple Database with track files received and their locations on disk.
  3. You can also have something to translate csv files to database records on demand. After that you will be able to do very useful things on them.

For any more questions, ask different questions to get appropriate/expert answers. (welcome to SO)