Skip to content

Instantly share code, notes, and snippets.

@hilfritz
Created December 5, 2021 13:42
Show Gist options
  • Save hilfritz/9e86f820cbae9a9aee720feb6ad94363 to your computer and use it in GitHub Desktop.
Save hilfritz/9e86f820cbae9a9aee720feb6ad94363 to your computer and use it in GitHub Desktop.
Python Stuff
#PYTHON FILTER String LIST VIA LAMBDA
list = ["Main.py", "util.py", "Test.py", "Main.java", "Util.java", "Test.java"]
#GET ALL FILES ENDING WITH .py
allpythonfiles = filter(lambda x: x.endswith(".py"), allfiles)
#GET ALL FILES ENDING WITH .java
allpythonfiles = filter(lambda x: x.endswith(".java"), allfiles)
SEE FOR MAP/FILTER
https://book.pythontips.com/en/latest/map_filter.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment