Quantcast
Viewing all articles
Browse latest Browse all 1247

Python • Re: Syntax error: positional argument follows keyword argument pymodbus

I copied this code into Thonny, and it is throwing a "Syntax error: positional argument follows keyword argument".
Can you please post the full error shown in Thonny as that may help identify where the error is exactly, why you are seeing it, and what the resolution would be.

It is often a mismatch between how a function is defined and how it is used ...

Code:

def test(a, b=None):    passtest(a=1, 2)

Code:

pi@Pi4B:/tmp $ python xyzzy.py  File "/tmp/xyzzy.py", line 3    test(a=1, 2)               ^SyntaxError: positional argument follows keyword argument
Putting Python code and error messages between [code] ... [/code] tags is also recommended. That allows its formatting and intentation to be retained.

Statistics: Posted by hippy — Tue Mar 04, 2025 4:06 pm



Viewing all articles
Browse latest Browse all 1247

Trending Articles