QpytonでKivyを使ってGUIアプリのサンプルを書いてみた
Androidで動作するPythonのQPythonを使ってみました。
Python自体、始めて3日位なので…。
import kivy from kivy.app import App from kivy.uix.label import Label from kivy.uix.button import Button from kivy.uix.boxlayout import BoxLayout class MyApp(App): def exit_wnd(self, *args): App.stop(self) def build(self): layout = BoxLayout(padding=10,orientation="vertical") exit_btn = Button(text = 'exit') exit_btn.bind(on_press=self.exit_wnd) layout.add_widget(Label(text = 'Hello, World')) layout.add_widget(exit_btn) return layout if __name__ == '__main__': MyApp().run()
イベントハンドラのexit_wndに渡してる*argsがどう使われるのか、いまいち理解してないけど…。
| 固定リンク
« pythonで二つの変数の値を交換(swap)する | トップページ | Authentication with old (insecure) passwords is not supported. For more information, lookup Password Hashing in the latest MySQL manual »
「python」カテゴリの記事
- python requests.exception.SSLError SSL接続でエラーが出る(2020.07.27)
- Python+mysqlconnectorでのサニタイジング(エスケープ)(2016.10.21)
- Python CGIでウェブアプリを作ってみる その1(2014.09.13)
- Python CGIでウェブアプリを作ってみる その1(2014.09.13)
- PythonでKInterbasDBを使ってFirebirdデータベースに接続してみる(2014.08.30)
コメント