Newbie question

Peak Allan apeak_2000 at
Mon Dec 24 00:32:50 CET 2001

I copied this code from one of the tutorials on the website, but when I tried to run it, I got
an error.

# Program FileTest

out_file = open("test.txt", "w")
out_file.write("This crap is going to out file\n")

in_file = open("test.txt", "r")
text =
print text

bash-2.05$ ./
./ line 3: syntax error near unexpected
token `open("'
./ line 3: `out_file = open("test.txt",

Can someone please tell me what I did wrong?

Also, are the tutorials at a good way to
learn Python?  If not, are there any other good online resources?

Do You Yahoo!?
Send your FREE holiday greetings online!

More information about the Python-list mailing list