italoseara / whatsappy

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

SyntaxError: invalid syntax #12

Closed adityash4rma closed 1 year ago

adityash4rma commented 2 years ago

Code:

from whatsappy import Whatsapp

whatsapp = Whatsapp() # Initialize the library

Error:

File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\whatsappy\main.py", line 590
    match __name:
          ^
SyntaxError: invalid syntax
yohannd1 commented 2 years ago

Does your python version support match? I don't remember if 3.9 does (it seems you're using Python 3.9), but it has been added recently. Try this code out:

x = 5
match x:
    case 10:
        print("test")

Does this error out?

Dare-Devill commented 2 years ago

match x:

Invalid syntax

yohannd1 commented 2 years ago

Yeah, you're not using a new-enough version of python then. I just googled it and it seems match was introduced in Python 3.10. From the path in the error it seems you're using Python 3.9. Are you able to update to 3.10?

And nonetheless I'll try to add some metadata to the package later so it errors out on older versions and warns 3.10 is needed.

yohannd1 commented 2 years ago

Damn, I just noticed that the person that replied wasn't the same that created the issue ._. Anyways, that doesn't change much: the question is for both of you then ((:

benioriginal commented 2 years ago

ayo,can i add u on discord? BainBan#0001 i have multiple errors and i can't figure out what i'm doing wrong.Thanks!

yohannd1 commented 2 years ago

Hello! Sure, I'll send you a message on there soon.

yohannd1 commented 2 years ago

Oh, okay, I can't add you. But here's my tag - YohananDiamond#2892