Python: execute files from the interpreter


/ Published in: Python
Save to your folder(s)

Scripts can also be executed from within the interpreter using the execfile(script) function built in to Python.
The following example shows a script being executed using the execfile() function:


Copy this code and paste it in your HTML
  1. >>> execfile("script.py")
  2. Executing a Script
  3. >>>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.