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

execfile mentioned in lesson 1.2.5 has been long deprecated in python3 #783

Open
krishnakumarg1984 opened this issue Jul 27, 2024 · 1 comment

Comments

@krishnakumarg1984
Copy link

krishnakumarg1984 commented Jul 27, 2024

In lesson 1.2.5, one of the notes says:

Other interpreters also offer the possibility to execute scripts (e.g., execfile in the plain Python interpreter, etc.).

However, execfile has long been deprecated in python 3. I think the relavent syntax in python3 is exec(open("./filename").read())

@stefanv
Copy link
Member

stefanv commented Jul 28, 2024

Since this is something you very seldom do (it would be better to import a module, rather than exec it), I'd opt for removing that box entirely.

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

No branches or pull requests

2 participants