組み込み関数 type() 使い方 type1 = type( obj ) 渡したobjのtypeを返します str1 = 'abc' type1 = type( str1 ) print(type1) #結果 <class ... 組み込み関数
組み込み関数 tuple() 使い方 tuple = tuple( iterable ) 渡したiterable をtupleに変換し返します list1 = tuple1 = tuple(list1) print(tuple1) #結果 (1, ... 組み込み関数
組み込み関数 bin() 使い方 str = bin(int) 整数を2進数に変換します先頭には2進数を示す0bが付きます str = bin(7) print(str) #結果 0b111 組み込み関数
組み込み関数 any() 使い方 bool = any(iterable) いずれかの要素が真のときTrueを返します value1=any() print(value1) #結果 False value2=any() print(value2... 組み込み関数
組み込み関数 filter() 使い方 filter = filter(function,iterable) functionの条件に合うiterableの要素を返します list1 = filter1 = filter(lambda x:x >... 組み込み関数
re re.sub() 置換 使い方 str = re.sub(置換前,置換後,対象,置換回数) 「対象」の中の「置換前」と一致する文字列を「置換後」に入れえます import re txt1 = 'a-aa-aaa' txt2 = ... re
time time.time_ns() 使い方 int = time.time_ns() UNIXエポックを基準とした経過ナノ秒が表示されますUNIXエポックは1970.1.1 0:0:0です import time int1 = time.time_ns()... time
組み込み関数 isinstance() 使い方 bool = isinstance( obj , type) objの型がtypeと一致した場合Trueが返ります bool1 = isinstance(111,int) print(bool1) #結果 Tru... 組み込み関数
Uncategorized ドラッグ&ドロップ① windnd windndを使用してドラッグ&ドロップされたファイルのリンクを取得 tkinterにドラッグ&ドロップします。 非常にシンプルですが2バイト文字が変換されてしまいます # pip install windnd impo... Uncategorized