Adding function to rearrange filenames-array
This commit is contained in:
parent
4cec8d2756
commit
f0c547f889
1 changed files with 7 additions and 0 deletions
|
|
@ -103,4 +103,11 @@ def get_filenames(path, ext, filter=''):
|
||||||
|
|
||||||
filenames = [os.path.join(path, filename) for filename in os.listdir(path) if os.path.isfile(os.path.join(path, filename)) and filename.endswith(ext) and filter in filename]
|
filenames = [os.path.join(path, filename) for filename in os.listdir(path) if os.path.isfile(os.path.join(path, filename)) and filename.endswith(ext) and filter in filename]
|
||||||
|
|
||||||
|
return filenames
|
||||||
|
|
||||||
|
def move_list_element_last(filenames,string):
|
||||||
|
for i,file in enumerate(filenames):
|
||||||
|
if string in file:
|
||||||
|
del filenames[i]
|
||||||
|
filenames.append(file)
|
||||||
return filenames
|
return filenames
|
||||||
Loading…
Add table
Add a link
Reference in a new issue