When i try to check if a file exists making use of the pathlib.Path method ".exists()" or "is_file()" what i get is False.
home = pathlib.Path.home()
path1 = home / r"Desktop\Python 3\Libro de Python3\my_directory\file1.txt"
path2 = home / r"Desktop\Python 3\file2.txt"
print(path1.exists())
print(path1.is_file())
print(path1.parent)
print("")
print(path2.exists())
print(path2.is_file())
print(path2.parent)
The output is:
False
False
C:\Users\Carlos\Desktop\Python 3\Libro de Python3\my_directory
True
True
C:\Users\Carlos\Desktop\Python 3
Why am i getting False for path1? is it because the path is too large?.
And yes, the file exists.