Python

環境
PyCharm 2021.3
Python 3.9.7

書式
round(数値,桁数)
round関数を使って四捨五入をします。
第2パラメータが丸める桁数です。第2パラメータ ...

Python

環境

PyCharm 2021.3Python 3.9.7

構文
文字列.isdecimal()
isdecimal関数を使って対象の文字列が数値のみかチェックします。
数値のみならTrue、数値以外 ...

Python

環境
PyCharm 2021.3
Python 3.9.2
書式
辞書型(dictionary)をリスト型で取得する
変数.items()

使用例

# 辞書型(diction ...

Python

環境

PyCharm 2021.3Python 3.9.7

書式
pow(base, exp)
base の exp 乗を返します; mod があれば、base の exp 乗に対する mod の剰余を返しま ...

Python

環境

PyCharm 2021.3Python 3.9.2

書式

for キーの変数 in 辞書型変数名: 処理コード

「for in」を使って「辞書型(dictionary)」からキーだけを取り出します。

Python

環境
PyCharm 2021.3
Python 3.9.2

書式
辞書型変数1 = dict(zip(リスト変数1,リスト変数2)
zip関数を使ってPythonの「リスト型(list)」 ...

Python

環境
PyCharm 2021.3
Python 3.9.2

書式
辞書名 = {キー:値}
変数1 =変数2 = 辞書名.copy()
copyメソッドを利用して辞書型(dicti ...

Python

環境

PyCharm 2021.3Python 3.9.2

書式
# 辞書型(dictionary)からkeysで取得する

for キーの変数 in 辞書型.keys(): 処理コード

辞書型(dictio ...

Python

環境

PyCharm 2021.3Python 3.9.2

書式
変数名 = 辞書型.copy()
copy関数を使って、辞書型(dictionary)をコピーします。
使用例

# 辞書型(di ...

Python

環境
PyCharm 2021.3
Python 3.9.2

構文
shutil.copytree(コピー元フォルダのパス,コピー先フォルダのパス)
フォルダをコピーし、なおかつフォルダ名も ...

Python

環境

PyCharm 2021.3Python 3.9.2

構文
shutil.copytree(コピー元フォルダのパス,コピー先フォルダのパス)
「shutil.copytree」を使ってフォルダをコピーし ...

Python

環境
PyCharm 2021.3
Python 3.9.7

構文
send2trash.send2trash(削除するファイルのパス)

使用例

import send2trash ...

Python

環境

PyCharm 2021.3Python 3.9.7

書式
os.unlink(‘c:\\path1\\path2\\ファイル名’)
「\」をエスケープする必要があるため、「\」 ...

Python

環境
PyCharm 2021.3
Python 3.9.7

書式
リスト =os.listdir(‘フォルダのパス’)
listdir関数を使ってフォルダのフォルダ ...

Python

環境

PyCharm 2021.3Python 3.9.7

書式
os.listdir(‘フォルダのパス’)
listdir関数を使ってフォルダの中のフォルダ・ファイルを取得します。 ...

Python

環境

PyCharm 2021.3Python 3.9.7

書式
os.listdir(フォルダのパス)
listdir関数を使ってフォルダの中のファイルを取得します。
「\」をエスケープする必要があ ...

CSS

環境
Google Chrome 103.0.5060.134
Windows 10 home 64bit
構文
border-left-color: 色の値 ;

使用例
左枠の色に ...

Python

環境
PyCharm 2021.3
Python 3.9.7

構文
タプル名 =(要素1,要素2,…)
リスト名 = list(タプル名)
list関数を使ってタプル(t ...