I have a simple Tkinter program that has a button and an entry. Now, how do I run code from the entry?
For example:
Entry -> print 'Hello!'
Button -> Run the entry command

Recommended Answers

All 2 Replies

Something like this can do ...

s = 'print "Hello!"'
exec(s)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.