Open JrtPec opened 8 years ago
Most important alert: when there is no data since xxx hours/days/...
to send an image without fysically writing a file to disk, this is probably a good start: http://stackoverflow.com/questions/28102803/python-pil-image-how-to-save-image-to-a-buffer-so-can-be-used-later
I would use BytesIO instead of StringIO though, something like this:
from io import BytesIO
import requests
image_buffer = BytesIO()
plt.save_image(..., file=image_buffer) # or whatever you do to save a plot to file
files = {'file': image_buffer.getvalue()}
r = request.post(url, files=files)
The idea: