This shows you how to communicate between Scratch 1.4 and Python 2/3. Click, press space, or use the arrow keys to navigate through the slides. If you have Python 2 installed, use the code under the comment with "PYTHON 2". If you have Python 3 installed, use the code under the comment with "PYTHON 3".
Scratch Wiki Python download: https://www.python.org/downloads/