Steve wrote: > def makeform(root, fields): > entries = {} > for field in fields: ... > return entries > > if __name__ == '__main__': > root = Tk() > ents = makeform(root, fields)
> > SR = (entries['Sensor_Reading'].get()) > print ("SR Outside = " + SR) > > ================================== > The last two lines were guesses but they still failed. [Always tell us how your code fails, please. If there's an exception include it and the complete traceback in your post.] In this case you probably get a NameError because 'entries' is a local variable in makeform(). In the global namespace the person you copied the code from used 'ents' -- so you have to either use ents, too, > if __name__ == '__main__': > root = Tk() ents = makeform(root, fields) ... SR = ents['Sensor_Reading'].get() or rename it > if __name__ == '__main__': > root = Tk() entries = makeform(root, fields) ... SR = entries['Sensor_Reading'].get() > # root.bind('<Return>', (lambda event, e = ents: fetch(e))) > #"fetch not defined" reported here Again, the author of the original code probably defined a fetch() function; if you want to use it you have to copy it into your script. -- https://mail.python.org/mailman/listinfo/python-list