Steven D'Aprano wrote:
> For those times when os.walk's behaviour doesn't mesh well with that of
> the external program you are calling (like macunpack) is there an
> alternative to:
>
> - save the cwd;
> - change directories;
> - call the program;
> - return to the saved directory
>
> ?
os.wal
On Wed, 28 Feb 2007 08:38:41 +0100, Peter Otten wrote:
> Does the problem occur if you pass an absolute path to
> os.walk()/os.path.walk()?
Well, arguably the problem is that macunpack insists on writing to the
current working directory.
Or the problem is that os.walk sets the working directory
Steven D'Aprano wrote:
> On Tue, 27 Feb 2007 20:31:43 -0800, Scott David Daniels wrote:
>
>>> def findallfiles(self, base):
>>> self.results = []
>>> for root,dirs,files in os.walk(base):
>>> os.chdir(root)
>>^^^ Mistake here, don't change directories durin
On Tue, 27 Feb 2007 06:22:51 +, Dennis Lee Bieber wrote:
[snip 350-odd file names]
> Just a sample of the start of a very long listing...
Thanks for sharing. What's with the nude ferret?
--
Steven D'Aprano
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 27 Feb 2007 20:31:43 -0800, Scott David Daniels wrote:
>> def findallfiles(self, base):
>> self.results = []
>> for root,dirs,files in os.walk(base):
>> os.chdir(root)
>^^^ Mistake here, don't change directories during os.walk ^^^
I came across this
Adam wrote:
> On Feb 26, 9:28 pm, [EMAIL PROTECTED] wrote:
>> i am trying to use python to walk thru each subdirectory from a top
>> directory. Here is my script:
>
> This bit below is from one of my first programs as I'm currently
> learning. It is designed
Whoops, the first bit of my reply ended up in the quoted text. See
above.
Adam
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 26, 9:28 pm, [EMAIL PROTECTED] wrote:
> i am trying to use python to walk thru each subdirectory from a top
> directory. Here is my script:
>
> savedPagesDirectory = "/home/meryl/saved_pages/data"
>
> dir=open(savedPagesDirectory, 'r')
>
_action(path)
# -
# Run it
list_dir(deldir, del_entry)
On 26 Feb 2007 13:28:20 -0800, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
i am trying to use python to walk thru each subdirectory from a top
directory. Here is my script:
save
[EMAIL PROTECTED] schrieb:
> i am trying to use python to walk thru each subdirectory from a top
> directory. Here is my script:
>
> savedPagesDirectory = "/home/meryl/saved_pages/data"
>
> dir=open(savedPagesDirectory, 'r')
>
> for file in dir:
>
#print path
_action(path)
# -
# Run it
list_dir(deldir, del_entry)
On 26 Feb 2007 13:28:20 -0800, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:
i am trying to use python to walk thru each subd
i am trying to use python to walk thru each subdirectory from a top
directory. Here is my script:
savedPagesDirectory = "/home/meryl/saved_pages/data"
dir=open(savedPagesDirectory, 'r')
for file in dir:
if (isdir(file)):
# get the full path of the f
12 matches
Mail list logo