Re: Problem reading/writing files

2006-08-04 Thread Roel Schroeven
[EMAIL PROTECTED] schreef: > Well, now I tried running the script and it worked fine with the .gfx > file. Originally I was working using the IDLE, which I wouldn't have > thought would make a difference, but when I ran the script on its own > it worked fine and when I ran it in the IDLE it didn't

Re: Problem reading/writing files

2006-08-04 Thread smeenehan
Well, now I tried running the script and it worked fine with the .gfx file. Originally I was working using the IDLE, which I wouldn't have thought would make a difference, but when I ran the script on its own it worked fine and when I ran it in the IDLE it didn't work unless the data was in a text

Re: Problem reading/writing files

2006-08-04 Thread Roel Schroeven
[EMAIL PROTECTED] schreef: > f = open('evil2.gfx','rb') > i1 = open('img1.jpg','wb') > i2 = open('img2.png','wb') > i3 = open('img3.gif','wb') > i4 = open('img4.png','wb') > i5 = open('img5.jpg','wb') > > > for i in range(0,67575,5): > i1.write(f.read(1)) > i2.write(f.read(1)) > i3.wr

Re: Problem reading/writing files

2006-08-04 Thread smeenehan
Ok, now I'm very confused, even though I just solved my problem. I copied the entire contents of the original file (evil2.gfx) from my hex editor and pasted it into a text file. When I read from *this* file using my original code, everything worked fine. When I read the 21st byte, it came up as the

Re: Problem reading/writing files

2006-08-04 Thread smeenehan
> What platform? What version of Python? Have you opened the > file in binary mode i.e. open('thefile', 'rb') ?? Show us the relevant > parts of your code, plus what caused you to conclude that read() > changed data on the fly in an undocumented fashion. Yes, I've been reading and writing everyt

Re: Problem reading/writing files

2006-08-03 Thread John Machin
[EMAIL PROTECTED] wrote: > This is a bit of a peculiar problem. First off, this relates to Python > Challenge #12, so if you are attempting those and have yet to finish > #12, as there are potential spoilers here. > > I have five different image files shuffled up in one big binary file. > In order

Re: Problem reading/writing files

2006-08-03 Thread Simon Forman
[EMAIL PROTECTED] wrote: > This is a bit of a peculiar problem. First off, this relates to Python > Challenge #12, so if you are attempting those and have yet to finish > #12, as there are potential spoilers here. > > I have five different image files shuffled up in one big binary file. > In order

Re: Problem reading/writing files

2006-08-03 Thread faulkner
have you been using text mode? [EMAIL PROTECTED] wrote: > This is a bit of a peculiar problem. First off, this relates to Python > Challenge #12, so if you are attempting those and have yet to finish > #12, as there are potential spoilers here. > > I have five different image files shuffled up in

Problem reading/writing files

2006-08-03 Thread smeenehan
This is a bit of a peculiar problem. First off, this relates to Python Challenge #12, so if you are attempting those and have yet to finish #12, as there are potential spoilers here. I have five different image files shuffled up in one big binary file. In order to view them I have to "unshuffle" t