sethserver / python
Explore Python's itertools module for efficient data processing and manipulation. Learn about iterators, generators, and key functions like cycle(), repeat(), chain(), product(), permutations(), and combinations(). Discover real-world applications and best practices for optimizing your code using itertools. read on »
Explore Python type hinting to improve code clarity, catch bugs early, and enhance development efficiency. Learn syntax, complex annotations, benefits, best practices, and tools like mypy for static type checking in this comprehensive guide. read on »
Explore advanced functional programming techniques in Python beyond list comprehensions. Learn about higher-order functions, lambda expressions, and practical applications using the functools module to write more elegant and efficient code. read on »
Discover Python's hidden gems: lesser-known built-in functions that boost productivity. Learn about enumerate(), zip(), any(), all(), and more to write efficient, readable, and Pythonic code. Elevate your Python skills with these powerful yet underutilized tools. read on »
Explore Python's context managers beyond basic 'with' statements. Learn to create custom managers, handle multiple resources, and use them for timing and logging. Discover how mastering context managers can enhance your Python skills and even relate to startup management. read on »
Explore Python's walrus operator (:=), a powerful feature for simplifying code. Learn its syntax, common use cases, potential pitfalls, and best practices. Discover how this assignment expression can enhance readability and efficiency in various programming scenarios, from data processing to game development. read on »
Python is an amazing language and it's easy to get started. However, there are a few things you should do to ensure your environment is setup properly. read on »
Let me reframe this question using different technology. Why are Toyota Corollas so popular despite being so slow? They're obviously much slower than rocket powered aircraft! Things just got crazy, right? Let's do some math to prove our point about how slow Toyota Corollas really are when compared to rockets. read on »
When working with Python dictionaries you'll find yourself needing to access a key that may or may not exist. The easiest way to do this is with the get() method. read on »
Python has some pretty amazing features, and one of its most powerful and versatile is the for loop. As you can see by the examples below the for loop in Python is quite powerful when used in conjunction with... read on »
The conciseness of the Python language paird with its easy-to-use REPL make it ideal to hack out quick and easy scripts. One thing you can do is quickly and securely generate a random password with practically one line of code. read on »
If you've spent any time working with Python environments you're bound to have run into errors such as pip: command not found, No module named pip, ModuleNotFoundError: No module named 'distutils.util', or other Python 2.x vs Python 3.x issues. read on »
Python helps make a lot of things really easy. The conciseness of the language make it awesome to accomplish simple tasks in as few lines as possible. One of these simple tasks is checking to see if a file exists. read on »
When debugging and profiling Python software you'll find yourself relying on Python's built-in logging module. Something that is very simple to overlook is the fact that the root logger defaults to WARN and not DEBUG. read on »
When using Python for Data Science or general Programming you'll find yourself needing to read and parse very very very large files. The easiest way to accomplish this is by iterating over the actual file object. read on »
When using Python for Data Science or general Systems Administration you'll find yourself needing to recursively read a directory tree, remember all (or some) of the files in the directories and then do something fun with those files. read on »
My wife is in charge of our families' annual Secret Santa Gift Exchange. Because she, unfortunately, knows about my background in math and computer science her requirements have become more extreme. read on »
When working with Python dictionaries you'll find yourself needing to access a key that may or may not exist. The easiest way to do this is with the get() method. read on »
In my mind the easiest way to understand Python's slice notation is to visualize it with real examples. Once you get it under your fingers you'll find list slicing is an invaluable tool to have in your Python toolkit. read on »