翻看《The Python Libary Reference》python库指南中附录index部分(P1899):
% (percent):
datetime format, 198, 594, 596
environment variables expansion (Windows), 377, 1798
interpolation in configuration files, 493
operator, 31
printf-style formatting, 51, 65
根据index中用法索引逐项来看:
环境变量扩展:
Expands environment variable placeholders %NAME% in strings like REG_EXPAND_SZ:
ExpandEnvironmentStrings('%windir%')
'C:\\Windows'
插入设置文件
home_dir: /Users
my_dir: %(home_dir)s/lumberjack
my_pictures: %(my_dir)s/Pictures
实例:
cls_info = ['%s\n(%d %s)'% (estimator_conf['name'],
estimator_conf['complexity_computer'](estimator_conf['instance']),
estimator_conf['complexity_label'])
for estimator_conf in configuration['estimators']]
查手册:
除了表示家目录外,表示操作符按位取反(the bits of inverted)
~5=-6
~-11=10
可以理解为取0为第一个正数,取坐标轴对称点。
解析见:https://blog.csdn.net/oAlevel/article/details/79267644