Re: [Tutor] Parsing os.popen(command) output

2005-09-14 Thread Travis Spencer
On 9/11/05, Bill Burns <[EMAIL PROTECTED]> wrote: > Like I said, it does work but can it be improved upon? The variable names could stand some improvement. p, r, s, tmp, i, etc. aren't very explanatory. If you choose better names, your coworkers, not to mention your future self, will be very tha

Re: [Tutor] Parsing os.popen(command) output

2005-09-11 Thread Bill Burns
Bill wrote: >> So I opted for this >> >> wRes = float(data[1].strip(',')) >> >> which seems to work fine. Orri wrote: > You could just do > > wRes = float(data[1][:-1]) (up to the last digit, which would be the comma) Orri, Thank you! I had never used slicing before (until today). I learn some

Re: [Tutor] Parsing os.popen(command) output

2005-09-11 Thread Orri Ganel
Bill Burns wrote: >Kent, > >Thank you for the reply! I knew there had to be a different way to do >it, I didn't like the three lists in there either :-) > >One thing: >I had to change the line > >wRes = float(data[1][1:]) > >it was returning '00,' (zero, zero, comma) instead of '400', so I >change

Re: [Tutor] Parsing os.popen(command) output

2005-09-11 Thread Bill Burns
[Bill] >>Here's the typical output from the command: >>[start output] >>TIFF Directory at offset 0x8 >> >> Subfile Type: (0 = 0x0) >> >> Image Width: 12000 Image Length: 16800 >> >> Resolution: 400, 400 pixels/inch >> >> Bits/Sample: 1 >> >> Compression Scheme: CCITT Group 4 >> >> Photo

Re: [Tutor] Parsing os.popen(command) output

2005-09-11 Thread Kent Johnson
Bill Burns wrote: > Hi, > > I'm parsing some output from a command that I execute with os.popen. > > Here's the typical output from the command: > [start output] > TIFF Directory at offset 0x8 > >Subfile Type: (0 = 0x0) > >Image Width: 12000 Image Length: 16800 > >Resolution: 400,