Easy operation of file path for CG industry.
Project description
#cgai-path
功能
应用于CG行业的文件路径
基本使用
import os
from cgai_path import CGAIPATH
p = r'C:\PyOut\Test\test_hiero\v001\musk_%04d.exr'
cpath = CGAIPATH()
# 判断提供的路径是否为序列
result = cpath.isSequence(p)
print(result) # ('C:\\PyOut\\Test\\test_hiero\\v001\\musk_', '%04d')
if result:
filename = cpath.get_filename(p)
print(filename) # musk
# 获取文件序列
paths,missings = cpath.get_files(p)
print(paths) # ['C:\\PyOut\\Test\\test_hiero\\v001\\musk_0001.exr',...,'C:\\PyOut\\Test\\test_hiero\\v001\\musk_0049.exr']
print()
print(missings)
a = r'C:\PyOut\Test\test_hiero\v001\musk_0001.exr'
# 获取文件名称
filename = cpath.get_filename(a)
print(filename) # musk_0001
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cgai_path-0.0.9.tar.gz
(7.5 kB
view details)
File details
Details for the file cgai_path-0.0.9.tar.gz
.
File metadata
- Download URL: cgai_path-0.0.9.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c29fa821ede7e13261be727ba3666691344e0cc6578d81cb0d54a19c4b715ce |
|
MD5 | e7da17ca81fb05219dde2855c587e7c6 |
|
BLAKE2b-256 | e2bb856a73b9dcb2d24c413e3d7d72a9f38af281dbfc34388f40b51b12db3112 |