Closed KumaTea closed 4 years ago
Please check the README.rst:
"Replacement for the ImageGrab Module, which works on Windows only, so Windows users don't need this library. "
You need this lib: https://pillow.readthedocs.io/en/latest/reference/ImageGrab.html
I deployed a Telegram bot service, using Python 3.7, on a server running Windows Server 2008 R2. Recently I found that pyscreenshot.grab() will cause flask to restart.
In the
main.py
:In a module used to debug:
scrst = scrshot.grab()
scrst.save('log/screenshot.png')
When the function
mddebug
is triggered, and just between thelog.csv
andscreenshot.png
is sent in order, the terminal prints something like:, which indicates a restart of the main.py file.
I found that a normal python script won't reproduce this issue, while scripts using flask will. I can't make sure if the restart is caused by pyscreenshot or flask.
I will appreciate it if you could tell the cause or ways to avoid this problem. Thanks.