magic.py

What is magic.py?

Magic is a small python module that has a range of utilities and functions that can be useful for a beginer at python, or even a master.

System Requirements

magic.py doesn't have any specific system requirements except that it needs python 3. Some functions do require internet acess though to acess some APIs, so please keep that in consideration.

Download

You can download the latest version here (you may need to right click and save as if it opens up in your brower)

Once downloaded, place into the same folder as your other python files

Usage

First start by importing the module there are two ways

import magic
from magic import *

The second one directly imports all the functions into your program, which means that you can ommit the magic. on the start of every function. For the sake of this tutorial, we will be using the first one

magic.p("This text will be printed letter by letter")
magic.p("There will be half a second between each of these letters gets printed", speed=0.5)

The sPrint() or the p() functions are for printing text out letter by letter, like in some text based RPGs. The speed can be adjuested as shown in the second code block above.

magic.title("Welcome to Python")

The title functions gives your text a nice border, and tries to centre it, so it looks pretty.

print(magic.mascii("hello"))
magic.print_ascii("hello")

This uses the api at http://artii.herokuapp.com/ to create ascii art. the second line shows