Surely I am missing something obvious. How can os.path.isfile() return True when given a scalar value?
>>> for i in range(0,20):    print(os.path.isfile(i))
... 
False
False
False
False
False
False
False
False
False
False
False
False
False
True
True
True
True
True
True
True
I am executing this from an empty directory. Python 3.6. I've looked at other questions about os.path.isfile() but I did not find an answer to this.
It's all in the docs:
True if path is an "existing" regular file.Trueos.path.exists returns TrueIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With