ウブンツとパイソンでグラフィカルなプログラムをする!4.実行ボタンを作る!

スポンサーリンク


ウブンツで確認すみです!
パイソンは世界でよく使われているプログラム言語なので利用者が多く、サンプルも多くあります!
パイソンのバージョンは3です。

実行ボタンを作る!

パイソンで「実行ボタンを作る!」するには、以下のプログラムを実行します

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import tkinter

def do():
    print("hi there, everyone!")

root = tkinter.Tk()
button = tkinter.Button(text="do",command=do)
button.pack()

tkinter.mainloop( )

それでは実行してみましょう。
04_Screenshot from 2016-05-30 06:29:07_001

実行されました。