日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

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

新聞中心

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

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

可以在模塊中找到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)庫(kù)的跟蹤使用,希望對(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)庫(kù)的跟蹤使用
文章地址:http://www.dlmjj.cn/article/cdsjged.html