日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)Python教程:python ChainMap標(biāo)準(zhǔn)庫的跟蹤使用

1、在與ChainMap起源密切相關(guān)的性能問題中,ConfigParser是其生活中的標(biāo)準(zhǔn)庫模塊。

可以在模塊中找到ChainMap作為一部分。這種方法使用字符串模板作為參數(shù),并且允許在PEP292中替換字符串。輸入字符串模板包含嵌入標(biāo)識(shí)符,您可以在以后用實(shí)際值替換:Templatestring。

>>> import string
 
>>> greeting = "Hey $name, welcome to $place!"
>>> template = string.Template(greeting)
 
>>> template.substitute({"name": "Jane", "place": "the World"})
'Hey Jane, welcome to the World!'

2、substitute()替換place提供的關(guān)鍵字參數(shù)值,而非輸入字典中的值。

用于ChainMap在名稱沖突時(shí)有效地管理輸入值的優(yōu)先級(jí)。

>>> import string
 
>>> greeting = "Hey $name, welcome to $place!"
>>> template = string.Template(greeting)
 
>>> template.substitute(
...     {"name": "Jane", "place": "the World"},
...     place="Real python"
... )
'Hey Jane, welcome to Real Python!'

以上就是python ChainMap標(biāo)準(zhǔn)庫的跟蹤使用,希望對(duì)大家有所幫助。更多Python學(xué)習(xí)指路:創(chuàng)新互聯(lián)python教程

本文教程操作環(huán)境:windows7系統(tǒng)、Python 3.9.1,DELL G3電腦。


網(wǎng)頁題目:創(chuàng)新互聯(lián)Python教程:python ChainMap標(biāo)準(zhǔn)庫的跟蹤使用
文章源于:http://www.5511xx.com/article/cdsjged.html