user8721345
user8721345

Reputation: 29

why os.path.isfile returns false if file is other directory?

Which path is used in os.path.isfile(filename) in python. I have file in /home/debian and I have added that path in PYTHONPATH variable still os.path.isfile(filename) returns FALSE.

Upvotes: 0

Views: 1081

Answers (1)

Michael Butscher
Michael Butscher

Reputation: 10959

If filenameis relative, the current working directory (available with os.getcwd()) is used.

PYTHONPATH is only used when importing modules.

Upvotes: 3

Related Questions