import os
allItems = os.listdir()


def sortFile(fileName):
    chapter = os.path.splitext(fileName)[0].split("-")[1]
    return int(chapter)


allItems.sort(key=sortFile)
print(allItems)

ff9c8a8c67eb4cd1c56cbba603148b220d3bf6e1
<mask token>


def sortFile(fileName):
    chapter = os.path.splitext(fileName)[0].split('-')[1]
    return int(chapter)


<mask token>

<mask token>


def sortFile(fileName):
    chapter = os.path.splitext(fileName)[0].split('-')[1]
    return int(chapter)


allItems.sort(key=sortFile)
print(allItems)

<mask token>
allItems = os.listdir()


def sortFile(fileName):
    chapter = os.path.splitext(fileName)[0].split('-')[1]
    return int(chapter)


allItems.sort(key=sortFile)
print(allItems)

import os
allItems = os.listdir()


def sortFile(fileName):
    chapter = os.path.splitext(fileName)[0].split('-')[1]
    return int(chapter)


allItems.sort(key=sortFile)
print(allItems)

import os
allItems = os.listdir()


def sortFile(fileName):
    chapter = os.path.splitext(fileName)[0].split("-")[1]
    return int(chapter)


allItems.sort(key=sortFile)
print(allItems)
