轻量级路径连接扩展。
项目描述
prodos
os
和 glob
扩展,具有高级路径连接。
安装
pip install prodos
用法
from prodos import prodglob, pathprod, prodmake
print('pathprod: creating a product of path items.')
for f in pathprod('base', ('a', 'b'), 'something', ('c', 'd')):
print(f)
print()
print('prodglob: globbing over the product of path items.')
for f in prodglob('base', ('a', 'b'), 'something', ('c', 'd')):
print(f)
fs = pathprod('base', ('a', 'b'), 'something', ('c', 'd'))
print('how many files exist?', sum(os.path.exists(f) for f in fs))
print()
print('prodmake: making directories from the product of path items.')
fs = prodmake('base', ('a', 'b'), 'something', ('c', 'd'))
print('how many files exist?', sum(os.path.exists(f) for f in fs))
print()
print('prodglob: globbing over the product of path items.')
for f in prodglob('base', ('a', 'b'), 'something', ('c', 'd')):
print(f)
输出
pathprod: creating a product of path items.
base/a/something/c
base/a/something/d
base/b/something/c
base/b/something/d
prodglob: globbing over the product of path items.
how many files exist? 0
prodmake: making directories from the product of path items.
how many files exist? 4
prodglob: globbing over the product of path items.
base/a/something/c
base/a/something/d
base/b/something/c
base/b/something/d
项目详情
关闭
prodos-0.0.1.tar.gz的散列
算法 | 散列摘要 | |
---|---|---|
SHA256 | 10933493f32dab11ca945813a670615cefdb0db00286b2ce06dd7ffc3c2cd197 |
|
MD5 | f5c445907ecb9a14b5e99ca99392736a |
|
BLAKE2b-256 | 826d22f4fcfad64167f7e38e938fe1da37871ed67a0733453134eb5c09e6934f |