How to share file on server with Python?

Hello
I need help with making a local

123.123.12.12:12345 like

server and Python utilities to read and write files to it. How to do it?
Thanks!

1 Like

To read a directory you wish to share, try this in the terminal (Python 3):

python -m http.server 9000

Note: do not use this in production.

1 Like

And it will be static, right? Or you can kinda quickly reload it somehow?

1 Like

What does “static” mean in this context? This is a “static file server” in the sense that contents are generated before the request comes in (in contrast to a “dynamic server” which generates content when it’s requested), but dynamic in the sense that it does not need to be reloaded when you add new or edit existing files; the file list and content is read only when a request asks for it.

1 Like

I mean, how to make utilities to read the files which are in this server directory with Python?

1 Like

What I described is how to quickly serve your content locally. “Making utilities” is a broad topic. You would have to specify what you are trying to do.

1 Like