1

I am using the windows7 command prompt and have opened the python interpreter and changed to the directory where the file is located. The instructions I have say to get into the directory and type

./keyboardControl.py 192.168.1.108

where keyboardControl.py is the name of the file and the ip address is for a robot.

I get the error:

File "", line 1 .\keyboardControl.py 192.168.1.108 SyntaxError: invalid syntax (with the carrot under the . before )

I have also tried:

python keyboardControl.py 192.168.1.108

I get the same error with the carrot now under the l in Control.

Any help would be greatly appreciated.

0

1 Answer 1

1

It sounds like you've launched the Python interpreter and are typing these commands into the REPL. This is not what you should be doing. The commands should be run directly at the cmd prompt, e.g.:

C:\Users\me>keyboardControl.py 192.168.1.108

If that does not work (file associations might not be set correctly - Windows does not handle the #! "shebang") the form would be.

C:\Users\me>python keyboardControl.py 192.168.1.108
Sign up to request clarification or add additional context in comments.

1 Comment

@user3687879 on Stack Overflow, the way you indicate that an answer helped you is actually by accepting it (clicking the green check box to the left of the question) instead of leaving comments thanking the user who answered.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.