forked from NishantGhanate/PythonScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathos.py
More file actions
36 lines (27 loc) · 862 Bytes
/
os.py
File metadata and controls
36 lines (27 loc) · 862 Bytes
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
import os
def rename_files(path):
for f in os.scandir(path):
if f.is_dir():
print(f.path)
file_list = os.listdir(f.path)
print(file_list)
else:
print(f.path)
# rootPaths = os.listdir(path)
# for r in rootPaths:
# print(path+r)
path = r"H:\Log"
# rename_files(path)
# def argument(arg1, *args):
# print ("First argument :", arg1)
# for arg in args:
# print("Tuple of *args :", arg)
# argument('Hello World', 'Welcome', 'to python', '')
# def Keyargument(**kwargs):
# for key, value in kwargs.items():
# print ("%s == %s" %(key, value))
# # Driver code
# Keyargument(first ='Breakfast', mid ='lunch', last='Dinner')
a = ["1.mp4","10.mp4","100.mp4","2.mp4","20.mp4","200.mp4"]
a = sorted(a, key=lambda x: int(x[:-4]))
print(a)