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

Python 3 execfile error #27

Merged
merged 1 commit into from
Aug 22, 2014
Merged

Python 3 execfile error #27

merged 1 commit into from
Aug 22, 2014

Conversation

laughedelic
Copy link
Owner

I am currently learning python and installed this plugin for sublime3, but when I tried to run my code I was getting this error " NameError: name 'execfile' is not defined. "

I did some googling and saw that execfile is different in python 3 (the version I am learning is 3.4).

I looked at the file " LoadFileToRepl.sublime-settings " in " Load file to REPL.sublime-package " in my installed packages folder.

On line 27 it says , "python_load_command" : "execfile("%s")"

I changed this line to , "python_load_command" : "exec(open("%s").read())"

This seems to have worked, now I can load my python3 code into the sublimeREPL with this plugin with no errors.

@laughedelic
Copy link
Owner

Hey @MITHX! It's cool that you found the solution by yourself!
I've checked that it works for python2 as well, so I'm fixing this.
Thanks!

@laughedelic laughedelic merged commit 9a2ba36 into master Aug 22, 2014
@laughedelic laughedelic deleted the bugfix/python3 branch August 22, 2014 22:32
@laughedelic laughedelic self-assigned this Aug 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant