Re: [Tutor] getting the size of an open TarFile object

2007-08-21 Thread Adam A. Zajac
> > I've been working with the tarfile module and just noticed an > > apparent flaw in my own logic. I wanted to add files to the tar > > until it neared a certain file size. After every addition I would > > use os.path.getsize(). What I noticed today is that I could add a > > file to the tar wi

[Tutor] getting the size of an open TarFile object

2007-08-18 Thread Adam A. Zajac
Hello all, I've been working with the tarfile module and just noticed an apparent flaw in my own logic. I wanted to add files to the tar until it neared a certain file size. After every addition I would use os.path.getsize(). What I noticed today is that I could add a file to the tar without th

Re: [Tutor] os.path.exists(path) returns false when the path actually exists!

2007-07-27 Thread Adam A. Zajac
> os.path.exists(path) returns false when the path actually exists! > > When I do this: > > >>> os.path.exists("c:\\winnt\\file_name") > > I get this: > >>> False > > Actually the file exists in c:\winnt, and I can confirm it exists > there, but os.path.exists isn't returning True, wh

Re: [Tutor] Question about code reviews

2007-07-12 Thread Adam A. Zajac
> Do you know of any service or person that could do a code review > for me? Perhaps if you were more specific about what you are looking for in the review? If you merely want something to check your code for possible errors and how well you stick to standards, then look into pylint or pychec

[Tutor] Removing a file from a tar

2007-06-27 Thread Adam A. Zajac
I was reading over the documentation for the tarfile module and it occurred to me that there didn't seem to be a way to remove an individual file from the tar. For example, suppose I did this: import tarfile tar = tarfile.open("sample.tar", "w") tar.add("unwanted") tar.add("wanted") tar.close()

Re: [Tutor] AttributeError: 'list' object has no attribute 'capitalize'

2007-06-20 Thread Adam A. Zajac
On Wed, 20 Jun 2007 12:32:53 +0200 Norman Khine <[EMAIL PROTECTED]> wrote: > My question is how to get all the words in the string to start with > capital letter? title() should do it >>>a = "hello world" >>>a.title() >>>'Hello World' ___ Tutor maillis