-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ufpy 0.1.1 (new function - number_of_files_with_extensions)
- Loading branch information
Showing
3 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
__version__ = '0.1' | ||
__version__ = '0.1.1' | ||
|
||
from .cmp import * | ||
from .math_op import * | ||
from .path_tools import * | ||
from .udict import * | ||
from .ustack import * | ||
from .utils import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
__all__ = ( | ||
'number_of_files_with_extensions', | ||
) | ||
|
||
import os | ||
|
||
def number_of_files_with_extensions(path, extension) -> int: | ||
r = 0 | ||
for p in os.listdir(path): | ||
if os.path.isdir(f'{path}/{p}'): | ||
r += number_of_files_with_extensions(f'{path}/{p}', extension) | ||
elif p.endswith(f'.{extension}'): | ||
r += 1 | ||
return r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,3 @@ py -3.12 -m twine upload dist\* | |
rd /s /q ufpy.egg-info | ||
rd /s /q dist | ||
rd /s /q build | ||
|
||
pause |