I'm using Blender 2.7 on my mac (OS 10.9.2) and the console won't properly open. If I open blender.app/Contents/MacOS/blender, I get a new terminal window, but it's full of a mix of legible and illegible characters such as "œ˙Ì˛Ä&àÖÄH__PAGEZERO__TEXTÃÃ". No print statements or errors will log there from Blender, either.
Anyone know what's going on?
Thanks!
Edit: I'm also new to terminal and was trying to use "open blender" from the /Contents/MacOS directory :P. If you type "./blender" from the parent directory, it works just fine.
If anyone could shed some light on what's happening or what the difference between typing "./filename" and "open filename" is, that would be awesome.
解决方案
Blender has various resources it needs to run that are located in the same folder as the binary, it starts with the current working directory to find them when you start blender.
In the terminal you are typing commands, there is a sequence (defined in the PATH variable) to where the command is searched for, prefixing the command with ./ is saying to run the command in the current working directory instead of searching through the PATH list for it.
The command open is meant to open editable files in a suitable editor, it would appear that it gets the idea that it can be handled with the terminal, except the new terminal will start in your home directory leaving blender unable to find it's resources. It's been a few years since I used OSX but it may also be trying to run the blender binary as a shell script. Either way open doesn't handle runnable binaries and isn't designed to.
So the difference is that open blender is like saying that you want to edit the file, but ./blender is actually running an application from the command line.
You may also find it fairly easy to create an applescript that tells the terminal to change the working directory and start blender. This can easily be saved as an application you can start from the finder. Which I think would be (untested) -
tell application "Terminal"
do script "cd /Applications/blender/blender.app/Contents/MacOS && ./blender"
end tell
And if all you want is the python output when you run your scripts you may want to try the script here - it lets you run a script in blender's python console to catch the output.
When you want blender specific help with python scripting ask at blender.stackexchange