exaloop / codon

A high-performance, zero-overhead, extensible Python compiler using LLVM
https://docs.exaloop.io/codon
Other
15.13k stars 520 forks source link

cannot import name “path” from “os.__init__” #572

Closed PartehDev closed 1 day ago

PartehDev commented 3 months ago

I was making a shorthand for the Codon compiler with codon itself and ran into an issue when trying to compile, which it only threw when I tried to use “os.path.isfile” to check if a file existed. I don’t know why it happens, other than maybe the function doesn’t exist in Codon.

arshajii commented 3 months ago

Hi @PartehDev -- some functionality from the os module doesn't exist yet in Codon, but you can import os from Python and use it as normal:

from python import os  # use Python's 'os' module
import sys
print(os.path.isfile(sys.argv[1]))

Relevant docs

inumanag commented 1 day ago

Merging into #608 .