O'Reilly logo

Python 2.6 Graphics Cookbook by Mike Ohlson de Fine

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The structure of an SVG drawing

We shall examine how Inkscape encodes drawings so that we may interpret them for use in Python. What we will do is:

  1. Draw some simple objects in Inkscape and save them somewhere as "Plain SVG" format files.
  2. Then we open the files in a text editor and inspect the contents so that we can recognize the lines we are interested in.
  3. Finally we write code that will convert the SVG lines of interest into Tkinter lists which we can use directly in our Python programs.

Getting ready

The first thing we need to do now is acquire and install a copy of Inkscape onto our computer. We will find this at www.inkscape.org/download/ where there are versions for Linux and Microsoft Windows.

The on-line documentation and tutorials for Inkscape ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required