Accessing Regina from Python

All of Regina's objects, classes and methods belong to the module called regina. For instance, you can create a new triangulation by calling regina.NTriangulation(), and you can read a data file by calling regina.readFileMagic(filename). Whenever Regina gives you access to Python (either through a graphical console, a script packet or a command-line session), it will automatically import the regina module for you to use.

Tip

If you have code that you find yourself writing again and again, you can put it in a user library. Regina will run all of the code in all of your user libraries at the beginning of every Python session (including graphical consoles, script packets and regina-python). User libraries are just ordinary Python files: you can maintain the current list of enabled libraries through Regina's Python options (or if you prefer, through the file ~/.regina-libs as described in the regina-python reference).

Documentation

Regina includes a complete API reference for its calculation engine, which describes in detail the objects, classes and methods that it makes available through Python. To read this documentation, select HelpPython API Reference from the menu. The API reference should open in your web browser (where you can bookmark it if you like). You can also read it online at regina.sourceforge.net.