Using Python’s DictCursor in MySQL to Return a Dict with Keys

The default MySQLdb library in Python only returns an array of values in the order you retrieve them. Here is an example: While that does the job, being able to call the fields using employee[‘name’], employee[‘position’] and employee[‘age’] makes a lot more sense. Here is how to use Python’s MySQLdb’s cursor library to return a …

Using Python’s DictCursor in MySQL to Return a Dict with Keys Read More »

XPS2-Z Zombie Stopper Holographic Sight by EOTech

  When it comes to killing zombies, accuracy is everything. Zombies are only susceptible to a shot to the brain, a severed spinal cord or the complete removal of the head. Knowing this, EOTech has developed a holographic weapons sight made specifically for killing zombies. Based on their XPS2 model holographic sight it features 20 …

XPS2-Z Zombie Stopper Holographic Sight by EOTech Read More »

Reading and Writing CSV Files with Python DictReader and DictWriter

Python can be an extremely powerful tool for reading and writing csv files. Here I’ll demonstrate an example of each using the csv DictWriter function. Sample File: (test.csv) firstname,lastname,age,favoritecolor john,smith,24,red jane,doe,26,blue sophe,miller,33,yellow jason,doe,21,red From here, I will import the csv file into a dictionary array using the csv DictReader function in the python console. You …

Reading and Writing CSV Files with Python DictReader and DictWriter Read More »