A successful sign for python setup
Project description
shutil_extra
extra utils
Build/Upload
# build
python setup.py sdist
# upload
twine upload ./dist/shutil_extra-x.x.x.tar.gz
Usage
dirtree
from shutil_extra import dirtree
tree_cnf = f'''
folder1
folder2_1,folder2_2
folder3_1->folder4
folder3_2->folder4->folder5_1,folder5_2
folder3_3->folder4
folder3_4->folder4
'''
# without post_handle
dirtree.makedirs('./folder_tree', tree_cnf)
# with post_handle
def post_handle(dirname, dirpath):
# do something after dir generated
if dirname == 'folder4':
with open(os.path.join(dirpath, 'data.txt'), 'w') as f:
f.writelines('hello world')
dirtree.makedirs('./folder_tree', tree_cnf, post_handle=post_handle)
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
shutil_extra-0.0.6.tar.gz
(3.5 kB
view details)
File details
Details for the file shutil_extra-0.0.6.tar.gz.
File metadata
- Download URL: shutil_extra-0.0.6.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c04eddfb2b38134878146bb681301631eb24b671ce6082dec60e519e2a176ec1
|
|
| MD5 |
db93b31fa76c05726cd67134d131800c
|
|
| BLAKE2b-256 |
f246f71cf2c82470a282034af1b6084547d115b17dd90c34a4da9026880fae9e
|