In this segment you are going to learn how make a python command line program to scrape a website for all its links and save those links to a text file for later processing. This program will cover many topics from making HTTP requests, Parsing HTML, using command line arguments and file input and output. Read More
Month: July 2017
Create user and user profile in CreateView using single Formset without using post_save signal
Before we begin I am using Python 3.5.2 and Django 1.11.3 and basic knowledge of Django models, forms and views is required, so let’s begin. When I first started learning Django one of the things I needed to do was create a user and a user profile at the same time in the same view Read More
How to use a different python version with virtualenv
A common question for beginning python programmers is how to set up and activate a virtual environment using virtualenv with a different python version. Fortunate for us the answers is pretty simple. First, let’s fire up a command line terminal and type this command: virtualenv -pvirtualenv -p 1.) The virtualenv command is used to create Read More
Select data from MySQL database as dictionary and iterate through it
In this tutorial we are going to look at how you can retrieve data from a MySQL database as a dictionary instead of a tuple using PyMySQL. Then using that data we will iterate through the dictionary and use logic to test for certain conditions, in this case, we will be testing if the first Read More