Running python script in Blender
You can also execute the following code in the python console to execute an external script without opening it up in the text editor:
filename = "/full/path/to/myscript.py"exec(compile(open(filename).read(), filename, 'exec'))
The above code comes from the following link:
- Open a Text Editor view in Blender.
- Press Alt + O, or go to Text>Open Text Block and open the .py file
- Then simply press Run script :D
P.s. Instead of opening a file in step 2, you can also hit the "+ New" button and create a new script instead.
Note : In newer versions the Run Script button label has been replaced with a Play icon :