Skip to content

Growing collection of helper functions implementing those little snippets you always have to google for.

License

Notifications You must be signed in to change notification settings

igrekus/forgot-again

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python utilities

Growing collection of helper functions implementing those little snippets you always have to google for.

Examples

Remove a file

# Write
remove_if_exists('unneeded.file')

# Instead of

if isfile('unneeded.file'):
    os.remove('unneeded.file')

# or
try:
    os.remove('unneeded.file')
except FileNotFoundError:
    pass

Make dirs:

# Write
make_dirs('dir')

# Instead of
if not isdir(path):
    makedirs(path)

# or
try:
    os.makedirs(path)
except FileExistsError:
    pass

TODO:

Priority:

  • Make a package

Meh:

  • Update readme
  • Add docstrings
  • Add more stuff

Warning

API will change, a lot.

About

Growing collection of helper functions implementing those little snippets you always have to google for.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages