Applied upstream as r3028 r3025 r3024
[PyX/mjg.git] / examples / hello.txt
blob18eba4e04ffb90374ba973a1b51563c938229e53
1 Hello, world!
3 As it is good practice to say "Hello, world!" in the first example, let's
4 discuss how to do that in PyX.
6 At first we import the PyX modules. Most PyX programs will start with a line
7 like that. In order to produce some output we create a canvas instance `c`.
8 Such an instance provides some useful methods to output some text at a certain
9 position and for directly stroking a path, for which we use a `line` instance
10 from the `path` module here. Once this is done, we write an EPS file and a PDF
11 file containing all items inserted into the canvas instance. Since we did not
12 pass a filename as argument to the write methods, the resulting files will just
13 be named as the Python script - minus the extension, of course.