Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
PartehDev opened this issue Jul 31, 2024 · 2 comments
Closed

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

PartehDev opened this issue Jul 31, 2024 · 2 comments

Comments

@PartehDev
Copy link

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
Copy link
Contributor

arshajii commented Aug 1, 2024

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
Copy link
Contributor

Merging into #608 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants