I hereby claim:
- I am xtream1101 on github.
- I am xtream1101 (https://keybase.io/xtream1101) on keybase.
- I have a public key whose fingerprint is 061A BAAC 9D1B E6EB 89F5 26AF 1498 1397 2F25 7A6D
To claim this, I am signing this object:
# I know dict's have `.get()`, this example was made to break if the key is not | |
# there to show the use of multiple try/except's | |
# Yes I know that having the except and else on 1 line each does not fit with PEP8 standards. | |
# But when you have many of them it helps reduce the size of the file and is no harder to read | |
data = {'some_key': 'key value'} | |
key_data = None | |
for _ in range(1): | |
try: | |
key_data = data['someKey'] |
I hereby claim:
To claim this, I am signing this object:
# Add this to your .bashrc or .bash_profile file to use | |
# | |
# This gives you access to create and switch between different python envs | |
# To create a venv called 'foo' just type: | |
# `pyve foo` | |
# This will create a python 3 venv and activate it as well | |
# If you are in a different venv and want to switch to foo, enter the same thing | |
pyve(){ | |
env_name=$1 | |
activate_file=~/Virtualenvs/py3/$env_name/bin/activate |
import sys | |
import csv | |
from pprint import pprint | |
row_list = [] | |
with open(sys.argv[1], 'r', encoding='ISO-8859-1') as f: | |
reader = csv.DictReader(f) | |
for row in reader: | |
# Make all keys lower case since we do not know the case used | |
row = dict((k.lower(), v) for k, v in row.items()) |
import re | |
from pprint import pprint | |
""" | |
TODO: | |
Support PORT numbers in the url | |
Support IP's as domains. If IP, it cannot have a subdomain or a tld | |
""" | |
""" |