from math import *
from visual.graph import *
min = -12
max = 12
steps = 256
filename = raw_input("Enter a filename: ")
function = raw_input("Enter a function: ")
file = open(filename+".txt", 'w')
deltax = (max-min)/float(steps)
graph = gdisplay()
curve = gcurve(gdisplay=graph)
x = min
for i in range(steps):
print >> file, x, eval(function)
curve.plot(pos=(x,eval(function)))
x = x + deltax
file.close()