Pyscreenshot suspended Python 3.4

I'm still new to python I use Python 3.4.0 in idle on Ubuntu 14.04

I want to take a screenshot. After research, it seems that pyscreenshot is a good solution I tried this after following the installation documentation

import pyscreenshot as ImageGrab

im = ImageGrab.grab()
im.show()

After using the print statement, I found that my problem did not work It seems to hang up

im = ImageGrab.grab()

I've read the documentation and tried to find a solution, but I can't find any help I tried a different backend to see if it solved the problem, but it always did the same thing

Update: I found that this is a problem with idle If I use the terminal and run the script with the python 3 Command, it will work properly If anyone knows why idle doesn't want to work please tell me. thank you.

Solution

You can turn off multiprocessing in pyscreenshot like

import pyscreenshot as ImageGrab
im = ImageGrab.grab(childprocess=False)
im.show()

I found the answer on this page Check it out https://github.com/ponty/pyscreenshot/issues/38

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>