Get List of font Path & Save it text file in Python

preview_player
Показать описание
In this video tutorial I will show you how to get font list with extension and save it in a text file using python.

You can also specify the file type such as .exe, jpeg, png etc.. to filter the files and save it to a text file.

Рекомендации по теме
Комментарии
Автор

import glob

# Correct the path using a raw string
path = r'C:\Windows\Fonts\*.ttf'
files = glob.glob(path)

# Open the file in write mode
with open('fonts_path_list.txt', 'w') as file:
for font in files:
file.write(f"{font}\n")

print("Font paths have been saved to fonts_path_list.txt")


ChatGPT ^^^

mustafatareq
join shbcf.ru