italoseara / whatsappy

A whatsapp api made with selenium in Python
MIT License
44 stars 8 forks source link

SyntaxError: invalid syntax (main) #9

Closed JonasCardoso closed 2 years ago

JonasCardoso commented 2 years ago

i tried use code exp, but i got this error, i forget something?

Traceback (most recent call last): File "zap.py", line 1, in from whatsappy import Whatsapp File "/home/jonas/.local/lib/python3.8/site-packages/whatsappy/init.py", line 1, in from .main import Whatsapp File "/home/jonas/.local/lib/python3.8/site-packages/whatsappy/main.py", line 591 match __name: ^ SyntaxError: invalid syntax

from whatsappy import Whatsapp

whatsapp = Whatsapp()

whatsapp.login(visible=False) # Login whatsapp (Headless mode)

chat = whatsapp.chat('Mom') # Goes to the selected chat
chat.send('Hello') # Send a message

whatsapp.close() # Exit
italoseara commented 2 years ago

you need to have python 3.10 to run it, it seams like you still are in python 3.9, that's why match case doesn't work

yohannd1 commented 2 years ago

Talking about that, I think we could add something to verify that and give an error message in case the wrong versin is being used. I think I know how to do it so I may help soon with it.

italoseara commented 2 years ago

Talking about that, I think we could add something to verify that and give an error message in case the wrong versin is being used. I think I know how to do it so I may help soon with it.

I think there is some way to make it not able to install if it's not 3.10 or above, I'll try to find it