Path: csiph.com!2.eu.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!storethat.news.telefonica.de!feedme.news.telefonica.de!telefonica.de!diesel.cu.mi.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 Subject: Range ciclo for User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Lines: 42 Message-ID: Date: Mon, 29 Feb 2016 15:11:45 +0100 NNTP-Posting-Host: 213.140.2.6 X-Complaints-To: newsmaster@fastweb.it X-Trace: tornado.fastwebnet.it 1456755104 213.140.2.6 (Mon, 29 Feb 2016 15:11:44 CET) NNTP-Posting-Date: Mon, 29 Feb 2016 15:11:44 CET Xref: csiph.com it.comp.lang.python:7611 Ciao a tutti, vorrei numerare il numero di file all'interno di una directory con python: >>> import os >>> x = os.listdir() >>> for i in x: >>> print(i) lastfile .profile Scaricati .ssh .python_history master.zip __pycache__ .adobe .macromedia .pip .bash_aliases Modelli .gconf .Xauthority Vorrei ottenere questo risultato: 1 lastfile 2 .profile 3 Scaricati 4 .ssh 5 .python_history 6 master.zip 7 __pycache__ 8 .adobe 9 .macromedia 10 .pip 11 .bash_aliases 12 Modelli 13 .gconf 14 .Xauthority Mi potete aiutare? Grazie