Ero sivun ”Python 2/GUI” versioiden välillä
Poistettu sisältö Lisätty sisältö
PyGTK |
Ei muokkausyhteenvetoa |
||
Rivi 1:
{{Python sivut|Tiedosto|Hello, world!}}
==Tkinter==
Tkinter perustuu Tcl-nimisen ohjelmointikielin Tk-käyttöliittymäkirjastoihin. Tkinter kuuluu Python-tulkin oletuspaketteihin.
<source lang="Python">
import Tkinter
class HelloWorld:
def __init__(self):
window = Tkinter.Tk()
window.title("Hei")
window.geometry("200x150")
hello = Tkinter.Label(window, text = "Hei maailma!")
hello.pack()
window.mainloop()
if __name__ == "__main__":
HelloWorld()
</source>
==PyGTK==
Rivi 52 ⟶ 77:
app.MainLoop()
</source>
*[http://beta.wikiversity.org/wiki/Python-kielisen_ohjelmoinnin_perusteet Python-kielisen_ohjelmoinnin_perusteet] (Wikiopiston opintopiirin opiskeluohjeita)
|