Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Tkinter is a *great** UI framework for beginners. I highly recommend using that, if it seems powerful enough to fill your needs.</p> <p>Since it sounds like you're pretty inexperienced as far as programming goes, here's what I recommend:</p> <p>1) Learn how to do basic IO, and especially learn Python's string formatting. It's super useful, and probably invaluable in your situation.</p> <p>2) Learn how to do SQL queries with SQLite - attach your Python IO skills to SQLite.</p> <p>3) Learn Python's object model - how it fits within the concept of OOP, and especially how you can make an object to fit your data model. Learn how this can work in between Python's IO and SQLite IO.</p> <p>4) Now that you're comfortable putting data into and getting data out of a SQLite database and a user, and can handle objects comfortably, it's time to start learning about event driven programming, mainloops, and GUI layouts. Tkinter is pretty simple and <a href="http://effbot.org/tkinterbook/" rel="nofollow noreferrer" title="Effbot">Effbot</a> has some rather good information about Tkinter.</p> <p>5) Tie all of these skills and knowledge together and make yourself a program. You'll probably have to go back and brush up, relearn, or learn some new things about 1-4 all along the way. Don't be afraid to re-factor code - if it seems like something is a pain to work with/around, you're probably doing <em>something</em> wrong, or just not seeing a solution right in front of your face. In some cases it's ignorance, in others you've just been looking at your program too long and may be married to the idea of doing it the "wrong" way. If your solution isn't simple, then you may be complicating the problem.</p> <p>6) Ask for help. If you get stuck, you can always ask here, or at the <a href="http://mail.python.org/mailman/listinfo/tutor" rel="nofollow noreferrer">python tutor mailing list</a> . Just tell/show what you've done, what you expect to happen, and what it does instead. Most pythonistas tend to be a rather helpful bunch, and even more so when you show you've been trying to work at it yourself.</p> <p>Anyhow, HTH, and good programming!</p> <p>*by great I mean it has good features, but it's not very pretty or overly complicated. Plus it comes standard with your Python install.</p> <p>For instance, a simple tkinter program with a label and a button could look like this:</p> <pre><code>import Tkinter as tk # Initialize a new root window root = tk.Tk() # Create a label that belongs to the root window hello = tk.Label(root, text='Hello') # Create a button that belongs to root, and will make the program # quit when pressed goodbye = tk.Button(root, text='Goodbye', command=root.quit) # Use the pack manager to add the button and label to the root # Window - do NOT mix pack and grid managers - they don't play well hello.pack() goodbye.pack() # Enter the mainloop root.mainloop() </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload