Why doesn’t it print “1” when I hold down the left mouse button?

Why doesn’t it print “1” when I hold down the left mouse button? There are no errors.

import time
import mouse

while mouse.is_pressed("left"):
    print("1")
    time.sleep(0.1)

Answer

You can do an infinite loop, like this:

while True:
    if mouse.is_pressed("left"):
        print(1)