1. Problema
Mostrar los archivo almacenados en un directorio.
2. Solución
La función listdir() del módulo os permite listar los archivos de un directorio (Beazly, Jones, 2013).
3. Código Python 3
Prueba de ejecución:
bfsvc.exe
bootstat.dat
comsetup.log
DDACLSys.log
diagerr.xml
diagwrn.xml
DtcInstall.log
explorer.exe
HelpPane.exe
hh.exe
LDPINST.LOG
LkmdfCoInst.log
mib.bin
notepad.exe
NvContainerRecovery.bat
PFRO.log
Professional.xml
py.exe
pyshellext.amd64.dll
pyw.exe
regedit.exe
setupact.log
setuperr.log
splwow64.exe
system.ini
twain_32.dll
win.ini
WindowsShell.Manifest
WindowsUpdate.log
winhlp32.exe
WMSysPr9.prx
write.exe
4. Literatura & Enlaces
Beazly D, Jones B. K. (2013). Python Cookbook, Third Edition. United States: O'Reilly Media.
O
No hay comentarios:
Publicar un comentario
Envíe sus comentarios, dudas, sugerencias, críticas. Gracias.