i was trying to put the math.py into a frame Ive watched many tutorials. But cant seem to find out how to or where to place the code the files I want combined are attached.
# import wx app = wx.PySimpleApp() frame = wx.Frame(None,-1,'hello') frame.Show(1) app.MainLoop()
import random name = raw_input ('Enter Name: ') def intro(name): print 'Hello,', name, 'welcome to Python Type an interactive learning environment' print ( 'for python. Please refer to "specific online tutorial"') print ('for in depth information on the lessons') raw_input('Press Enter to continue...') intro(name) def mat(): class R(object): @property def x(self): return random.randint(500, 1000) @property def y(self): return random.randint(500, 1000) ran = R() print 'Okay',name, 'lets get started first we\'ll do some simple math' print 'in this exersize you\'ll use' print ' * for multiplying integers' print ' + for adding integers' print ' - for subtracting numbers and' print ' / for dividing' print 'Try now by multipying(* = Shift8) enter like so: ' u = ran.y x = ran.x print u,'*',x def t(): v = u*x z = input('Enter Here: ') print z if z == v: print 'Good Job!!' fin() if z == False : print 'Please try again' t() else: print 'Please try again' t() t() def fin(): a = raw_input ('Would you like to(cont)(quit)? ') if a == 'cont': mat() if a == 'quit': print 'end' else: print ("not a command"); fin() mat()
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor