Quoting "Martin v. Löwis" <[EMAIL PROTECTED]>:
> >> os.chdir("~/dir1")
> >
> > It is not mentioned in the documentation but I'm pretty sure os.dir()
> doesn't do
> > tilde expansion since this is usually performed by a shell.
> >
> > You should use instead:
> >
> > os.chdir(os.join(os.environ['HOM
>> os.chdir("~/dir1")
>
> It is not mentioned in the documentation but I'm pretty sure os.dir() doesn't
> do
> tilde expansion since this is usually performed by a shell.
>
> You should use instead:
>
> os.chdir(os.join(os.environ['HOME'], 'dir1'))
Or
os.chdir(os.path.expanduser("~/dir1"))
R
Quoting Maryam Saeedi <[EMAIL PROTECTED]>:
> I have a problem using os.chdir on linux. What should I do if I want to
> change to root directory? The below does not work:
>
> os.chdir("~/dir1")
It is not mentioned in the documentation but I'm pretty sure os.dir() doesn't do
tilde expansion since t
2008/3/7, Maryam Saeedi <[EMAIL PROTECTED]>:
>
> I have a problem using os.chdir on linux. What should I do if I want to
> change to root directory? The below does not work:
>
> os.chdir("~/dir1")
>
> Thanks
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>>> os.getcwd()
'/home/micha
A simple way to get all the files throughout the directory sturcture...
You may have to rewrite the "CONVERTING" part.
import os, glob
for root, dirs, files in os.walk(os.getcwd()):
for file in files:
if file.endswith(".mp3"):
print "File: " + os.path.abspath(os.path.join(
In article <[EMAIL PROTECTED]>,
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> #!/usr/bin/python
>
> from os import *
>
> chdir("/home/chainlynx/Desktop/Music")
> for artist in listdir(getcwd()):
> print "===ARTIST: "+artist
> chdir(artist)
> for album in listdir(getcw
>> for album in listdir(getcwd()):
doesn't listdir give you subdirectories AND files?
So, then if you try to: chdir(album)
If album is a file, it chokes?
Just a guess. I'm on Windows, not Linux.
rd
--
http://mail.python.org/mailman/listinfo/python-list