Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8013

Python • Re: Syntax error when installing pynput with pip install pynput

$
0
0
With [code]...[/code] tags ...

Code:

        cmd = [sys.executable, 'evdev/genecodes.py', *headers]                                                     ^    SyntaxError: invalid syntax
And that's correct for Python 2 which you seem to be using.

This is acceptable in Python 3 -

Code:

cmd = [sys.executable, 'evdev/genecodes.py', *headers]
This should be an equivalent in Python 2 -

Code:

cmd = [sys.executable, 'evdev/genecodes.py']for this in headers:    cmd.append(this)
No idea if that will work and there is probably more stuff in the code which won't work with Python 2.

Statistics: Posted by hippy — Sat May 04, 2024 10:17 pm



Viewing all articles
Browse latest Browse all 8013

Trending Articles