Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > it.comp.lang.python > #7682

Listdir

Newsgroups it.comp.lang.python
From Smith <smith@smith.com>
Subject Listdir
Message-ID <t7gzz.96$qi6.69@tornado.fastwebnet.it> (permalink)
Date 2016-09-05 17:25 +0200

Show all headers | 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 | NextNext in thread | Find similar


Thread

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