fix defaults for x any y (to be strings)
[PyX.git] / examples / hello.txt
blob8ecd7a68ddd3682a2b74905d8f9a1db4668f9f7f
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.
15 This rather minimal example is quite useful for debugging your setup. In case
16 of problems with your installation, you can add a `pyxinfo()` call immediately
17 after the import. PyX will then write various information to `stderr`, which is
18 quite helpful for yourself or when asking for help on the mailing list.