本文整理汇总了Python中scripts.core.base.Paths.split方法的典型用法代码示例。如果您正苦于以下问题:Python Paths.split方法的具体用法?Python Paths.split怎么用?Python Paths.split使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scripts.core.base.Paths
的用法示例。
在下文中一共展示了Paths.split方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_path_dict
# 需要导入模块: from scripts.core.base import Paths [as 别名]
# 或者: from scripts.core.base.Paths import split [as 别名]
def create_path_dict(filename):
path = Paths.split(filename)[1:-1]
result = dict()
for i in range(len(path)):
result['+' + str(i)] = path[i]
result['-' + str(i)] = path[-i]
return result
示例2: _extract_parts
# 需要导入模块: from scripts.core.base import Paths [as 别名]
# 或者: from scripts.core.base.Paths import split [as 别名]
def _extract_parts(filename):
parts = Paths.split(filename)
test = parts[-3]
case = parts[-2].split('.')[0]
nproc = int(parts[-2].split('.')[1])
return {
"test-name": test,
"case-name": case,
"nproc": nproc
}