-2

I'd add path form pathlib to my vscode but whenever I call it's modules like path.stat I have an error,and vscode won't allow me to use () for calling

from pathlib import Path 

path=Path("enum/__init__.py")

pri=path.stat
print(pri)

the error is:bound method Path.read_bytes of WindowsPath('enum/init.py')

Brett Cannon
  • 14,438
  • 3
  • 45
  • 40
Arezoo
  • 1
  • 1

1 Answers1

0

Unix systems uses slash as separator (/) in filenames.
On Microsoft Windows backslash (\) is used.
So, your code should be edited as follows:

from pathlib import Path 

path=Path(r"enum\__init__.py")

pri=path.stat
print(pri)
Aleksey
  • 775
  • 5
  • 14