alonn...@gmail.com wrote:
>and when I run it I get an invalid syntex error and (as a true newbie
>I used a GUI)in_a_not_b is highlighted in the with open("inAnotB.csv",
>"wb") as f: 
>    writer = csv.writer(f) 
>    writer.writerows([item] for item in_a_not_b)
                             ^^^^^^^^^^^^^^^^^^^^

The syntax for the for-clause in a comprehension is

for x in something

thus you are missing the "in" keyword:

writer.writerows([item] for item in in_a_not_b)

Bye, Andreas
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to