Calculadora básica de fracciones

 #!/usr/bin/python
# -*- coding: utf-8 -*- 
# PEQUEÑA CALCULADORA DE FRACCIONES.
from fractions import Fraction
a = Fraction(3, 5)
b = Fraction(8, 12)
c = a + b
print "(3/5) + (8/12):", c
d = Fraction(4, 6)
e = Fraction(56, 23) 
f = d - e 
print "(4/6) - (56/23):", f
g = Fraction(27, 35)
h = Fraction(17, 22) 
i = g * h 
print "(27/35) * (17/22):", i
j = a + b - e * g
print "(3/5) + (8/12) - (56/23) * (27/35)", j


Salida:

(3/5) + (8/12): 19/15
(4/6) – (56/23): -122/69
(27/35) * (17/22): 459/770
(3/5) + (8/12) – (56/23) * (27/35) -211/345