Created
July 14, 2018 12:20
-
-
Save Fhernd/6c8e2f06865432e5fc93bbfeb34b9e2a to your computer and use it in GitHub Desktop.
Comprobar la existencia de un archivo o carpeta. OrtizOL.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# Comprobar existencia carpeta Windows: | |
print(os.path.exists('C:\\Windows')) | |
# Comprueba si un archivo existe: | |
print(os.path.exists('C:\\com.bat')) | |
# Determinación de tipo de recurso: | |
print(os.path.isdir('C:\\Windows')) | |
print(os.path.isfile('C:\\Windows\explorer.exe')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment