The easiest way to get started writing PsychoPy scripts is to look at the demos included (there’s a demo menu in the Coder view). One thing to note though, is the need to tell PsychoPy about your monitor using the Monitor Center first.
Below are a couple of demos that explain the code in greater detail than the demos.
As you get more comfortable with the basics you will start to want the detailed info in the API (Reference) and, for the advanced, you should learn a lot from the actual source code.
Contents: