Py之utils:Python庫(kù)之utils的簡(jiǎn)介、安裝、使用方法之詳細(xì)攻略
Py之utils:Python庫(kù)之utils的簡(jiǎn)介、安裝、使用方法之詳細(xì)攻略
目錄
utils的簡(jiǎn)介
utils的安裝
utils的使用方法
utils的簡(jiǎn)介
Python Utils is a collection of small Python functions and classes which make common patterns shorter and easier. It is by no means a complete collection but it has served me quite a bit in the past and I will keep extending it.
python utils是一個(gè)小型python函數(shù)和類的集合,這些函數(shù)和類使公共模式變得更短、更容易。它絕不是一個(gè)完整的,但它在過(guò)去為我服務(wù)了不少,我會(huì)繼續(xù)擴(kuò)展它。
文檔:https://python-utils.readthedocs.io/en/latest/
utils的安裝
pip install python-utils
utils的使用方法
1、基礎(chǔ)用法
from python_utils import converters
number = converters.to_int('spam15eggs')
assert number == 15
number = converters.to_int('spam')
assert number == 0
number = converters.to_int('spam', default=1)
assert number == 1
number = converters.to_float('spam1.234')
Python
版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔(dān)相應(yīng)法律責(zé)任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實(shí)的內(nèi)容,請(qǐng)聯(lián)系我們jiasou666@gmail.com 處理,核實(shí)后本網(wǎng)站將在24小時(shí)內(nèi)刪除侵權(quán)內(nèi)容。
版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔(dān)相應(yīng)法律責(zé)任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實(shí)的內(nèi)容,請(qǐng)聯(lián)系我們jiasou666@gmail.com 處理,核實(shí)后本網(wǎng)站將在24小時(shí)內(nèi)刪除侵權(quán)內(nèi)容。