Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > it.comp.lang.python > #7682
| Path | csiph.com!news.fcku.it!bofh.it!tornado.fastwebnet.it!53ab2750!not-for-mail |
|---|---|
| Newsgroups | it.comp.lang.python |
| X-Mozilla-News-Host | news://news.fastwebnet.it:119 |
| From | Smith <smith@smith.com> |
| Subject | Listdir |
| User-Agent | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-15; format=flowed |
| Content-Transfer-Encoding | 8bit |
| Lines | 14 |
| Message-ID | <t7gzz.96$qi6.69@tornado.fastwebnet.it> (permalink) |
| Date | Mon, 5 Sep 2016 17:25:16 +0200 |
| NNTP-Posting-Host | 2.235.183.179 |
| X-Complaints-To | newsmaster@fastweb.it |
| X-Trace | tornado.fastwebnet.it 1473089113 2.235.183.179 (Mon, 05 Sep 2016 17:25:13 CEST) |
| NNTP-Posting-Date | Mon, 05 Sep 2016 17:25:13 CEST |
| Xref | csiph.com it.comp.lang.python:7682 |
Show key headers only | View raw
Ciao a tutti,
volevo sapere perchè nonostante i file siano presenti sulla directory
che scrivo in input mi restituisce file not found.
Mi potete aiutare?
Grazie
a = input("Digita la directory dove vuoi trovare i file py: ")
for file in os.listdir(a):
if file.endswith(".py"):
print(file)
else:
break
print("File not found")
Back to it.comp.lang.python | Previous | Next — Next in thread | Find similar
Listdir Smith <smith@smith.com> - 2016-09-05 17:25 +0200
Re: Listdir Claudio_F <clau.fin@tin.it> - 2016-09-05 17:58 +0200
Re: Listdir Smith <smith@smith.it> - 2016-09-05 18:39 +0200
Re: Listdir Claudio_F <clau.fin@tin.it> - 2016-09-05 18:50 +0200
Re: Listdir Enrico Bianchi <enrico.bianchi@ymail.com> - 2016-09-24 17:30 +0000
csiph-web