Re: determining bytes read from a file.

2007-12-13 Thread vineeth
On Dec 13, 7:50 pm, Chris <[EMAIL PROTECTED]> wrote: > A couple potential optimizations: > > > > > # create the member variable name. > > mem_var_name = options.inputfilename > > mem_var_name = mem_var_name.replace(' ','_') > > mem_var_name = mem_var_name.replace('.','_') > > mem_var_name = options

Re: determining bytes read from a file.

2007-12-13 Thread Chris
A couple potential optimizations: > > # create the member variable name. > mem_var_name = options.inputfilename > mem_var_name = mem_var_name.replace(' ','_') > mem_var_name = mem_var_name.replace('.','_') > mem_var_name = options.inputfilename.replace(' ','_').replace('.','_') No need to assign

Re: determining bytes read from a file.

2007-12-13 Thread Matt Nordhoff
vineeth wrote: > parser.add_option("-b", "--bytes", dest="bytes") This is an aside, but if you pass 'type="int"' to add_option, optparse will automatically convert it to an int, and (I think), give a more useful error message on failure. -- -- http://mail.python.org/mailman/listinfo/python-list

Re: determining bytes read from a file.

2007-12-13 Thread vineeth
On Dec 13, 5:27 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Thu, 13 Dec 2007 04:04:59 -0800, vineeth wrote: > >I have come across a weird problem, I need to determine the amount > > of bytes read from a file, but couldn't figure it out , > >My program does this : > > __ > >

Re: determining bytes read from a file.

2007-12-13 Thread John Machin
On Dec 13, 11:04 pm, vineeth <[EMAIL PROTECTED]> wrote: > Hello all, >I have come across a weird problem, I need to determine the amount > of bytes read from a file, but couldn't figure it out , >My program does this : > __ >file = open("somefile") >data = file.read() >print "by

Re: determining bytes read from a file.

2007-12-13 Thread vineeth
On Dec 13, 5:13 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > vineeth wrote: > > Hello all, > >I have come across a weird problem, I need to determine the amount > > of bytes read from a file, but couldn't figure it out , > >My program does this : > > __ > >file = open("somefile")

Re: determining bytes read from a file.

2007-12-13 Thread John Machin
On Dec 13, 11:04 pm, vineeth <[EMAIL PROTECTED]> wrote: > Hello all, >I have come across a weird problem, I need to determine the amount > of bytes read from a file, but couldn't figure it out , >My program does this : > __ >file = open("somefile") >data = file.read() >print "by

Re: determining bytes read from a file.

2007-12-13 Thread Marc 'BlackJack' Rintsch
On Thu, 13 Dec 2007 04:04:59 -0800, vineeth wrote: >I have come across a weird problem, I need to determine the amount > of bytes read from a file, but couldn't figure it out , >My program does this : > __ >file = open("somefile") >data = file.read() >print "bytes read ", len(d

Re: determining bytes read from a file.

2007-12-13 Thread Diez B. Roggisch
vineeth wrote: > Hello all, >I have come across a weird problem, I need to determine the amount > of bytes read from a file, but couldn't figure it out , >My program does this : > __ >file = open("somefile") >data = file.read() >print "bytes read ", len(data) > --- > > But t

determining bytes read from a file.

2007-12-13 Thread vineeth
Hello all, I have come across a weird problem, I need to determine the amount of bytes read from a file, but couldn't figure it out , My program does this : __ file = open("somefile") data = file.read() print "bytes read ", len(data) --- But the bytes read is not being printed cor