mirror of
https://github.com/Kludex/awesome-fastapi-projects.git
synced 2025-02-25 09:28:39 +00:00
11 lines
363 B
Python
11 lines
363 B
Python
|
import os
|
||
|
from tempfile import TemporaryDirectory
|
||
|
from typing import Generator, TextIO
|
||
|
|
||
|
|
||
|
def get_python_files(dir: TemporaryDirectory) -> Generator[TextIO, None, None]:
|
||
|
for dirpath, _, filenames in os.walk(dir.name):
|
||
|
for filename in filenames:
|
||
|
if filename.endswith(".py"):
|
||
|
yield open(os.sep.join([dirpath, filename]), "r")
|