Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'example:': 0.03; 'builtin': 0.07; 'filename': 0.07; 'root,': 0.07; 'subject:file': 0.07; 'subject:form': 0.07; 'python': 0.09; 'iterate': 0.09; 'os.path': 0.09; 'received:151': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; '2.7.3': 0.16; 'dirs,': 0.16; 'emanuele': 0.16; 'generator.': 0.16; 'os:': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'jan': 0.18; '>>>': 0.18; 'module': 0.19; 'written': 0.20; 'import': 0.21; 'supposed': 0.21; 'tried': 0.25; 'header:User-Agent:1': 0.26; 'displays': 0.27; 'module.': 0.27; 'tree': 0.27; "doesn't": 0.28; 'header:X -Complaints-To:1': 0.28; 'writes:': 0.29; 'function': 0.30; 'to:addr:python-list': 0.33; 'list': 0.35; 'received:org': 0.36; 'but': 0.36; 'itself': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'skip:o 20': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'help': 0.40; 'more': 0.63; 'walk': 0.71; 'you:': 0.75; 'join,': 0.84; 'lien': 0.84; 'quando': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Lele Gaifax Subject: Re: Downloading a file form a displayed table Date: Tue, 05 Mar 2013 12:29:25 +0100 Organization: Nautilus Entertainments References: <91d6d661-1e6b-4365-8fa3-e46425705d78@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 151.62.65.84 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:e+rO5wPt5VRx28Ymrbaol8FcbIc= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362482981 news.xs4all.nl 6924 [2001:888:2000:d::a6]:58255 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40519 Νίκος Γκρ33κ writes: > How is this lien supposed to be written do to iterate over a list of filenames? > > for filename in list( os.walk(path) ): > > i tried the above but still it doesn't work out. Please learn how Python itself can help you: $ python Python 2.7.3 (default, Jan 2 2013, 13:56:14) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> help(os.walk) Help on function walk in module os: walk(top, topdown=True, onerror=None, followlinks=False) Directory tree generator. ... Example: import os from os.path import join, getsize for root, dirs, files in os.walk('python/Lib/email'): ... In general, the builtin help() function displays the documentation for either a single function or a whole module. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. lele@metapensiero.it | -- Fortunato Depero, 1929.