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
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
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
[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
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,