Receiving the below error when running my script:
Traceback (most recent call last):
File "HC_Main.py", line 54, in <module>
setup_exists = os.path.isfile(config_file)
AttributeError: 'function' object has no attribute 'isfile'
Sample code is:
import os
setup_exists = os.path.isfile(setup_exists)
if setup_exists is False:
print "Setup file exists"
When I checked the IDLE console with dir(os.path)
, isfile
is listed. Additionaly, I can use the function without issues in IDLE as well.
Could it be my IDE causing issues here? I've also tried running the script apart from the IDE, but it still receives the error.