Skip to content

Example code seems to be wrong #21

@daftshady

Description

@daftshady

https://python-mss.readthedocs.io/en/dev/examples.html#playing-with-pixels

In this example, sct.monitor is passed directly to grab method.
In osx, grab changes a value of monitor param. As a result of it, the value of sct.monitor is also changed because python passes reference of dict rather than copying it.
(https://github.com/BoboTiG/python-mss/blob/master/mss/darwin.py#L182)

I think it's better to copy the dict before passing it to grab.

sct_img = sct.grab(sct.monitors[1].copy())

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions