sethserver / python
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 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 »
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 »