[Tutor] Re: Getting "file sizes" !Sovled!! For real.. Heh..Heh..

Joshua Banks syn_ack at comcast.net
Thu Feb 26 11:40:51 EST 2004


----- Original Message ----- 
From: "Blake Winton" <bwinton at latte.ca>
> That's exactly when you would want to use os.path.join.  Because
> if you have:
> basedir = getHomeDirectory( "jj" )
>   # returns either "C:\\Documents and Settings\\jj\\" or "/home/jj/"
> subdir = "Desktop"
> subfile = "file.txt"

> So now you want to create the path of basedir + subdir + subfile,
> but that's not going to work, because you don't know what separator
> to add between subdir and subfile, because you don't know which OS
> you're running on.  And that's where os.path.join comes in.  You
> can just pass it all the bits, and it will figure it out for you.

> Make sense?

Kindof. Heh..Heh...

I guess it will make total sense once I'm able to figure out how to
incorparate "os.path.walk". I'm researching that right now. Thanks for
recapping on your comments though. That helps. Reading the Python Lib pdf is
like reading Unix man pages. Unix/linux was cryptic at first but I got used
to it. Written by engineers for engineers it seems. And it seems rightly so
with all the Python doc's I have.  So it will just take some time for me to
get used to Python is all. Thanks for your help or any further suggestions.

Joshua Banks




More information about the Tutor mailing list