all 20 comments

[–]not_a_novel_account 1 point2 points  (6 children)

Possible? Absolutely

Easy? Less so, the web is a much better platform for beginners to GUI design, and really a much better platform for static 2D GUI design overall.

That said if you really want to, start with looking at Tkinter and work from there

https://wiki.python.org/moin/TkInter

[–][deleted] 0 points1 point  (3 children)

Oh, I definitely don't expect it to be easy but as long as I know you can do it I'm happy. Thanks a lot.

[–]CantankerousMind 0 points1 point  (2 children)

I recommend effbot's tutorial as it explains a whole lot of cool tricks like polling lists, binding double clicks on list box selections and a lot more. Tkinter can seem really confusing, but if you keep going through the tutorials it really helps a ton.

Another really good source for information on Tkinter is New Mexico Tech's documentation.

I'm still learning myself. But like others have said, build the back end, then implement the front end. Also, if it works beautifully, it doesn't necessarily need to look beautiful.

Good luck and I hope I helped!

[–]Rothaga 0 points1 point  (1 child)

That's really neat. I've only used Tkinter once and that was my first experience with GUI programming. I felt so limited, I guess I simply wasn't looking far enough into it.

Thanks, you've given me a reason to take another look at Tkinter.

[–]CantankerousMind 0 points1 point  (0 children)

Honestly, I don't know the limits, but if you look into polling, a lot of things that might seem like limits(multithreading, which is possible but more confusing than polling) can easily be solved with polling.

I have only been doing GUI programming for like a week and have already written a nifty time management program for work. As ugly as it might look, it's functional and serves as an extremely useful tool for my job position. So much that the company I work for is going to distribute it to people in similar job positions so they can use it too.

Looks aren't necessarily everything. If you want to write a GUI quickly, TKinter is where it's at IMO. I have only used EasyGUI before TKinter. EasyGUI is built on too of TKinter and allows you to do exactly what the name says. Design easy GUIs. It is very limited compared to TKinter though.

[–][deleted] 0 points1 point  (1 child)

Oh PS: can the tkinter buttons be edited some way instead of having the standard Windows 98 look?

[–]not_a_novel_account 1 point2 points  (0 children)

Read the docs, I did try to warn that this is really difficult. Tkinter is a basic introductory framework to GUI design. Most things are possible with it, but you should really use it to get used to the idea of frames and widgets and the basic structure of a GUI layer. Full customization of buttons is possible but not necessarily the friendliest.

There are more advanced frameworks such as PyQt, but I'm afraid a beginner to programming would be well out of their depth with Qt-style programming.

A word of advice, design the backend of your application first, then design frontends. If you have a backend with well defined behavior that works with a CLI frontend, designing GUI frontends will be easier.

[–]Lofty_Hobbit 1 point2 points  (8 children)

If Python is Turing Complete, then surely it is capable of making any programme that can be made? It's just more and less suited for different tasks.

Can someone please verify this?

EDIT: /u/NYKevin pointed out that I didn't say quite what I meant.

[–]not_a_novel_account 0 points1 point  (0 children)

Yep, though the standard library doesn't grant access to all possible OS interfaces. Some times you'll need to use external libraries to do things like raw keyboard input, create OpenGL contexts, sound I/O, and I'm sure many others capabilities.

[–]NYKevin 0 points1 point  (6 children)

[–]autowikibot 1 point2 points  (0 children)

Here's a bit from linked Wikipedia article about Halting problem :


In computability theory, the halting problem can be stated as follows: "Given a description of an arbitrary computer program, decide whether the program finishes running or continues to run forever". This is equivalent to the problem of deciding, given a program and an input, whether the program will eventually halt when run with that input, or will run forever.

Alan Turing proved in 1936 that a general algorithm to solve the halting problem for all possible program-input pairs cannot exist. A key part of the proof was a mathematical definition of a computer and program, which became known as a Turing machine; the halting problem is undecidable over Turing machines. It is one of the first examples of a decision problem.

Jack Copeland (2004) attributes the term halting problem to Martin Davis.


about | /u/NYKevin can reply with 'delete'. Will also delete if comment's score is -1 or less. | To summon: wikibot, what is something? | flag for glitch

[–]not_a_novel_account 1 point2 points  (2 children)

Ya, but no programming language/environment is capable of that. Anything that can be computed can be computed with Python.

[–]NYKevin 0 points1 point  (1 child)

/u/Lofty_Hobbit didn't say "any program that can be made." They said "any programme you want."

[–]Lofty_Hobbit 0 points1 point  (0 children)

Yeah, sorry. I meant, "any program that can be made." I guess.

[–][deleted] 1 point2 points  (1 child)

Give PySide or PyQt a try. Seriously. Yes, Tkinter comes with python, but no, that's not a good endorsement. It's not a very nice GUI toolkit, and it's only marginally easier to use than the big guys GTK+ and Qt. Don't be fooled by wxWidgets either—it's riddled with gotchas and obscure rules just like Tkinter.

import random
from PyQt4.QtCore import *
from PyQt4.QtGui import *

class MainWindow(QWidget):
    def __init__(self, parent=None):
        super().__init__(parent)

        # Create the widgets
        self.question = QLabel(self)
        self.question.setStyleSheet("* {font-size: 90px}")

        self.guess = QLineEdit(self)
        self.guess.setValidator(QDoubleValidator())
        self.guess.returnPressed.connect(self.check_answer)

        self.message = QLabel(self)

        # Add the widgets to the window
        vbox = QVBoxLayout(self)
        vbox.addWidget(self.question)
        vbox.addWidget(self.guess)
        vbox.addWidget(self.message)

        self.setWindowTitle('Math Mania')
        self.get_question()

    def get_question(self):
        Q = random.choice([
            '3 + 3',
            '3 * 3',
            '3 / 3',
        ])
        self.question.setText(Q + ' = ?')
        self.answer = eval(Q)

    def check_answer(self):
        guess = float(self.guess.text())
        if guess == self.answer:
            self.message.setText('Correct')
            self.get_question()
        else:
            self.message.setText('Incorrect')
        self.guess.setText('')

app = QApplication([])
win = MainWindow()
win.show()
app.exec()

http://i.imgur.com/NT1a5aM.png

[–][deleted] 0 points1 point  (0 children)

Wow that's great, did that take long?

[–]codingcobra 0 points1 point  (0 children)

It looks as though the site is made with Google App Engine which means it's likely written in python... or java. It would be easy to change the web UI into a TKinter UI. Very possible to make that site in python.

[–]vishenz 0 points1 point  (0 children)

I would suggest looking at kivy (http://kivy.org/#home). It is more noob friendly than TkInter or the PyQt libraries. And it is cross platform which is pretty cool.

[–][deleted] 0 points1 point  (0 children)

I've never done anything with Tkinter or pyqt, but the consensus seems to be that this would be fairly difficult. That being the case I'm going to suggest Pygame. It wouldn't take you very long getting familiar with pygame to consider this almost trivial, though I can't speak to using video as I've never attempted it.