3

I am using pynput and am trying to get the mouse to click, for which I import from pynput:

from pynput.mouse import Button, Controller

Then in line 8, I do this:

button = Button.Left

And as a result, I get this error:

Traceback (most recent call last):
  File "C:/FILEPATH.py", line 8, in <module>
button = Button.Left
      File "C:\Program Files (x86)\Python\Python37-32\lib\enum.py", line 346, in __getattr__
raise AttributeError(name) from None
    AttributeError: Left

Do you know what I am doing wrong, or what's missing here?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
JMP
  • 43
  • 1
  • 2
  • 4

1 Answers1

4

Just looking at the docs, it should be Button.left with a lowercase l rather than Button.Left with an uppercase l.

iz_
  • 15,923
  • 3
  • 25
  • 40