You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from platform import system
def mss(*args, **kwargs):
""" Factory returning a proper MSS class instance
It detects the plateform we are running on
and choose the most adapted mss_class to take
screenshots.
It then proxies its arguments to the class for
instanciation.
"""
mss_class = {
'Darwin': MSSMac,
'Linux': MSSLinux,
'Windows': MSSWindows
}[system()]
return mss_class(*args, **kwargs)
So so mss can be used as simply as:
from mss import mss
screenshotter = mss()
for f in screenshotter.save():
print(f)
This avoid to write the same boiler plate over and over fow the most common use case.
The text was updated successfully, but these errors were encountered:
Something like:
So so mss can be used as simply as:
This avoid to write the same boiler plate over and over fow the most common use case.
The text was updated successfully, but these errors were encountered: