Skip to content Skip to sidebar Skip to footer

How To Save A Text File Received In A Post Request Using Python

from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer import SocketServer class S(BaseHTTPRequestHandler): def _set_headers(self): self.send_response(200)

Solution 1:

data = ['hey there']
with open('filehere.txt', 'w') as file:
    for item in data:
        file.write("%s\n" % item)

I hope that is at least some kind of a guideline.


Post a Comment for "How To Save A Text File Received In A Post Request Using Python"