run blender python scripts from terminal?

Hi, ho do I run a script from the command line ? I tried blender -h, but didn’t see relevant info. I would like to do this becuase the text editor inside isn’t sufficient for me to test my code. also can’t use spe because I am on OS X and wxpython has issues on OS X. How i am doing it now is writing my code in vi, and then to test I restart python and run the script, but it wastes too much time like that. So what I am trying to find is if there is a way to do somethign like this:
blender -run thispythonscript.py

You can’t do it. :frowning:

You can, however, hit ALT-R to reload a Blender text window from a file on disk.

I’m writing my program in external files for another reason (to have ‘persistent’ objects…), but a nice side-effect is the ease of testing – this way also possible on several machines without updating the .blend file.

For example you say in the .blend only: import myprogram.py

Then edit myprogram.py in your favourite editor (Emacs for me :wink: and run it from Blender with no changes in the .blend, restarting etc. required.

Dunno if this would work for you or others but I’ve found it quite nice. There might be nasty issues lurking though… (e.g. in case of a game I’m not sure how it works when making runtime bundles…)

~Toni

Hi,
You could try blenpy which ships with spe, because it doesn’t need wxPython.
Unzip the release zip file. Copy the blenpy and sm folders to your lib/site-packages folder or to the folder where is the Blender program. Open the spe.blend file and press Alt+P in the blenpy text window.
Maybe it is possible to launch idle, than you have an interactive shell. But I don’t know if it works in os x. But for sure the blenpy python browser should work. See first image of http://stani.host.sk/python/blenpy.html

I would like to do this becuase the text editor inside isn’t sufficient for me to test my code. also can’t use spe because I am on OS X and wxpython has issues on OS X.

Just to know, what are these issues?

Stani

http://spe.pycs.net
http://www.stani.be