Я сделал, как показано ниже
Код: Выделить всё
import os
# current working directory
print(os.getcwd())
# files present in that directory
dir_contents = os.listdir('.')
# below is the output of the dir_contents
print(dir_contents)
['.test.json.crc', '.wf_list_dir_param.py.crc', 'test.json', 'wf_list_dir_param.py']
Мне нужно сделать ниже
- найти элементы, которые начинаются с wf и заканчиваются на param.py
- извлечь все до _param.py как переменная
Подробнее здесь: https://stackoverflow.com/questions/793 ... -in-python
Мобильная версия