Head First Programming
A learner's guide to programming
using the Python language
( O'Reilly Media; )
David Griffiths (著) Paul Barry (著)
開発環境
- OS X Mavericks - Apple(OS)
- Emacs (CUI)、BBEdit - Bare Bones Software, Inc. (GUI) (Text Editor)
- Python (プログラミング言語)
Head First Programming A learner's guide to programming using the Python language (David Griffiths(著)、Paul Barry(著)、 O'Reilly Media; )のChapter 7(Building a Graphical User Interface: Going all gooey)、SHARPEN YOUR PENCIL(p.235)を解いてみる。
SHARPEN YOUR PENCIL(p.235)
コード(BBEdit)
sample235.py
#!/usr/bin/env python3 #-*- coding: utf-8 import tkinter app = tkinter.Tk() app.title('TVN') app.geometry('280x100+200+100') correct_button = tkinter.Button(app, text='Correct Answer', width=10) correct_button.pack(side='left', padx=10, pady=10) wrong_button = tkinter.Button(app, text='Wrong Answer', width=10) wrong_button.pack(side='right', padx=10, pady=10) app.mainloop()
入出力結果(Terminal)
$ ./sample235.py $
0 コメント:
コメントを投稿