If you are new to python, you may be asking how to run these scripts on the raspberry pi. Astrotutor answered the same question over on the forums as follows:
Save the file in the same folder as the minecraft.py file, that is mcpi/api/python/mcpi.
Then open the game from the LXTerminal by typing
cd mcpi (enter)
Then from another opened LXTerminal (this is how I do it) type
cd mcpi/api/python (Enter)
One note — all the scripts here assume there is a “mcpi” subdirectory in the same directory as the script — and the mcpi contains all of the python scripts used to interact with minecraft. These are all up on the github as well!
Hope this helps
Edit: Thanks for the comments, in whatever directory you are running the scripts — you must have a subdirectory named mcpi. e.g.
run “python script.py” and it should run fine…