2019-08-01から1ヶ月間の記事一覧

【Python】 Python ~ 基本編 / クラス・継承 ~

■ はじめに Pythonのクラスについて、扱う。 なお、クラスじゃないが、Nullについても扱う。 目次 【0】Null 【1】クラス 【2】継承 【3】namedtuple (名前付きタプル) 【4】Context Managers(コンテキストマネージャ) 【0】Null * Python は「Non…

【トラブル】【.NET】単体試験実行中に DirectoryNotFoundException が発生する

■ はじめに 単体試験実行中に 以下の「エラー内容」が発生した ■ エラー内容 System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.Pla…

【Python】 Python ~ 基本編 / 繰り返し ~

■ はじめに Python の繰り返しを学ぶ 目次 【1】繰り返し文 1)for文 2)while文 【2】制御文「break / continue」 【3】zip 【4】else文 【1】繰り返し文 1)for文 2)while文 1)for文 構文 for 【カウンタ変数】 in 【繰り返す範囲/リスト】: …

【Python】Python ~ 基本編 / 日付・日時 ~

■ はじめに Python の 日付・日時 ・時間をメモ 英語だけど、以下がわかりやすい https://www.programiz.com/python-programming/datetime 目次 【1】日時・日付・時間の取得 【2】相互変換 1)文字列⇔日時の変換 2)timestamp ⇔ datetimeの変換 3)uni…

【Python】Python ~ 基本編 / 例外処理 ~

■ はじめに Python の 例外処理 (try 節 など) を学ぶ 目次 【1】try - except - finally 【2】raise 【3】else 【4】contextlib.supress 【1】try - except - finally 例1:ゼロ割 print("Enter") try: number = 0 answer = 100/number print(answer)…

【Python】 Python ~ 基本編 / 標準入力 input ~

標準入力 構文 【変数】 = input() サンプル line = input() result = int(line)*100 print(result) 複数行の場合 sys.stdin.readlines()を使う サンプル import sys array = [] for line in sys.stdin.readlines(): array.append(line.rstrip()) print(arra…

Markdownモードについて ~ Yahooブログから引っ越したので ~

■ はじめに Yahooブログのサービス停止に伴い、はてなブログ へ引っ越した Yahooブログでは、Wiki記法で書いてたが、 はてなブログだと、代わりになりそうなのが、 Markdownモードってのがあるので 必要最低限で学ぶ また、Github の README.md の記法にも繋…