Answer the question
In order to leave comments, you need to log in
How to sort the list of files?
There is a list of files. How can I sort it by the number in the name? Now like this:
import glob
file_list = glob.glob('startandroid/test/*.html')
new_file_list = [x.split('/')[-1] for x in file_list]
for x in sorted(new_file_list):
print(x)
Урок 1. Введение..html
Урок 10. Оптимизируем реализацию обработчиков..html
Урок 100. Service. IntentService. Foreground. Автозагрузка сервиса.html
Урок 101. Создаем свой ContentProvider.html
Урок 102. Touch – обработка касания.html
Урок 103. MultiTouch – обработка множественных касаний.html
Урок 104. Android 3. Fragments. Lifecycle.html
Урок 105. Android 3. Fragments. Динамическая работа.html
Урок 106. Android 3. Fragments. Взаимодействие с Activity.html
Урок 107. Android 3. ActionBar. Размещение элементов.html
Урок 108. Android 3. ActionBar. Навигация - табы и выпадающий список.html
Урок 109. Android 3. Fragments. ListFragment - список.html
Урок 11. Папка res_values. Используем ресурсы приложения..html
Урок 110. Android 3. Fragments. DialogFragment - диалог.html
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question