On May 15, 12:07 pm, globalrev <[EMAIL PROTECTED]> wrote: > On 15 Maj, 19:04, globalrev <[EMAIL PROTECTED]> wrote: > > > when i try to write to the file... > > > Traceback (most recent call last): > > File "C:\Python25\myPrograms\netflix\netflix.py", line 10, in > > <module> > > d.write('hej du galne kock') > > IOError: [Errno 0] Error > > damn i take a break lol. > > r+ ldo when open file so i CAN write to it...
That traceback doesn't provide much help ("[Errno 0] Error"...), but I remember that one time I got it when trying to write to a file opened for reading. Make sure you're opening the file for writing (passing "w" as the second argument to open(), or "wb" if you're writing binary data). Also, as everyone keeps pointing out to you, watch out for backslash scapes -- double the slashes ("\\", that really means a single \ to Python), use forward slashes ("/", perhaps not the most elegant solution, but it always works), or put an "r" next to the string (r"your\path"). The last form is the easiest, but it only works if you're typing a literal; you'll eventually need to double slashes (e.g., for replacing something in a string: s.replace("/", "\\")). -- http://mail.python.org/mailman/listinfo/python-list