This document includes instructions on how to run a local server on your computer using Python.
You may need to run a local server for all of the features of p5 to work. On a Mac, you should already have Python installed which has an easy built-in way to start up a server from your project. Open up your terminal and try this:
$ python --version
If python is installed you should see something like Python 2.7.8
(you may have a different version installed). If you get an error you may need to download and install Python (you will want to install version 2.x.x, not 3.x.x).
Once you're sure that you have Python, go to your project folder:
$ cd [path to your project]
(Hint: an easy way to do this is type cd
and add a space, then drag your project folder into the Terminal window, then hit return)
Once you're there, try this command:
python -m SimpleHTTPServer
If it worked, you should see something like this:
Serving HTTP on 0.0.0.0 port 8000 ...
Now you have a server running on your computer! Go to http://localhost:8000/ to check it out!
You can stop the server by either:
- Closing the terminal window
- Typing control+C