Advertisement
Fhernd

comprobar-existencia-archivo-carpeta.py

Jul 14th, 2018
1,293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. import os
  2.  
  3. # Comprobar existencia carpeta Windows:
  4. print(os.path.exists('C:\\Windows'))
  5.  
  6. # Comprueba si un archivo existe:
  7. print(os.path.exists('C:\\com.bat'))
  8.  
  9. # Determinación de tipo de recurso:
  10. print(os.path.isdir('C:\\Windows'))
  11. print(os.path.isfile('C:\\Windows\explorer.exe'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement