gendata.py

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()

Generated by GNU enscript 1.6.3.