コンテンツへスキップ

Python あれこれ

Python tips

Python あれこれ

月: 2018年6月

クラスの継承とオーバーライド

## オーバライドした関数が親クラスからも呼ばれる例


class base(): def __init__(self): return def a(self): print ("base") def b(self): self.a() class inhe(base): def __init__(self): return def a(self): print("infe") if __name__ == '__main__': inhe = inhe() inhe.b()

この結果はちゃんと

infe

となる。

投稿者 techu投稿日: 2018年6月17日カテゴリー 未分類クラスの継承とオーバーライドにコメント

while ループ

do~while型はないみたい?

while not IsEnd:
  #処理の内容
  if A == B :
    IsEnd == True
投稿者 techu投稿日: 2018年6月17日カテゴリー 基本パッケージwhile ループにコメント

最近の投稿

  • mutagenでMP3のヘッダデータ中のコメントを編集して保存する
  • Remote-SSH プラグイン実行時にcould not to establish connection to エラー
  • Visual Studio CodeでAnaconda環境を使う
  • Mozcを郵便番号対応にする
  • MozcのWindowsでのビルド(コンパイル)

最近のコメント

  • WindowsでKivyを使う に yamada より

アーカイブ

  • 2024年5月
  • 2020年2月
  • 2020年1月
  • 2019年2月
  • 2019年1月
  • 2018年6月
  • 2017年9月
  • 2017年6月
  • 2017年5月

カテゴリー

  • Web自動化
  • Wordpress
  • その他Tips
  • メール処理
  • ライブラリ
  • 仕事効率化
  • 基本パッケージ
  • 未分類

LInks

  • しろしろ
Python あれこれ Proudly powered by WordPress