-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.py
48 lines (40 loc) · 1.42 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from pythanos.snap import Snap
from pathlib import Path
import shutil
# if __name__ == '__main__':
# obj = Snap(r"E:\REQ\abcdefgh")
# obj.is_valid_dir(do_on_err='delete')
# obj = Snap(r"E:\REQ\abcd")
# obj.serve(host='localhost', delay=0)
# obj = Snap(r"""http://i3.ytimg.com/vi/J---aiyznGQ/mqdefault.jpg""")
# newpath = obj.download_from_url().unzip()
# obj2 = Snap(newpath)
# print(obj.get_nth_dirs(path=r"E:\REQ\abcd", n=2))
# if __name__ == '__main__':
# obj = Snap(r"E:\REQ\abcd")
# obj.zip(root_dir=r"E:\REQ\abcd")
# a = False
# for i in Path(r"E:\REQ\New folder\5").iterdir():
# if ''.join(i.suffixes) not in list(set(['.pdf'])):
# print(i)
# for i in Path(r"E:\REQ\New Folder").iterdir():
# a = True
# print(type(i))
# else:
# if a is False:
# print("yes")
# if __name__ == '__main__':
# obj = Snap(r"E:\REQ\abcd")
# obj.is_valid_dir(err_log_mode='json')
# print(Path(r"E:\REQ\New Folder").name)
# print(type(Path(r"E:\REQ\New Folder")))
# print(Path(Path(r"E:\REQ\New Folder")).name)
# print(Path(r"E:\REQ\New Folder").joinpath(r"E:\REQ\New Folder\abcd"))
# print(Path(r"E:\REQ\New folder\5\lattex.txt").suffixes)
# shutil.rmtree(Path(r"E:\REQ\New Folder1"))
# for i in range(100000+1):
# obj.progbar(i, 100000, "ywdufubfuebfub4ui")
# # obj = Snap("")
# print(obj.get_nth_dirs(r"C:\Users", n=1))
# # obj.group_by_exts(exts=['pdf', 'jpg'])
# obj.send_to_server(host="155")