[Tutor] Comparing two lines of print

Alan Gauld alan.gauld at blueyonder.co.uk
Wed Jun 2 05:23:25 EDT 2004

> When I attempt to run this script I get a syntax error:-
> [root at penguin bob]# ./readfile.py
>    File "./readfile.py", line 14
>      if text_file.readline() == [PORT 6 (PTCPACTOR) - 19 - UA6ADV-0]
>                                       ^
> SyntaxError: invalid syntax

You are comparing a string (from raw_input()) with a list.
I assume you need quotes around the [PORT....-0] stuff?

Alan G

More information about the Tutor mailing list