os.path.isfile

Chris Angelico rosuav at gmail.com
Fri Feb 10 15:28:05 EST 2017


On Sat, Feb 11, 2017 at 6:50 AM, Vincent Vande Vyvre
<vincent.vande.vyvre at telenet.be> wrote:
> Interesting, you're right.
>
> Python 3.4.3 (default, Nov 17 2016, 01:08:31)
> [GCC 4.8.4] on linux
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import os
>>>>
>>>> os.path.isfile('/home/vincent/oqapy-3/trunk/__pycache__/grid.cpython-34.pyc
>>>> ')
> False

Works on my system, in 3.4, 3.5, 3.6, and 3.7:

Python 3.4.4 (default, Apr 17 2016, 16:02:33)
[GCC 5.3.1 20160409] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.isfile("__pycache__/foo.cpython-36.pyc")
True

There's gotta be a difference here somewhere.

ChrisA



More information about the Python-list mailing list