Posts Tagged with Python

19 Apr 2019, 23:59

Install MySQL and MySQLClient(Python) in MacOS
Connecting to MySQL from Python in MacOS is a very problemtic and painful process. In this post, we are going to see how to install MySQL and connect it from a Python Application using mysqlclient: Step One: Install Brew You need to install Homebrew in you local machine. You can do it by:

12 Apr 2019, 01:06

Create Proxy Object in Python
Lets say you have been using a class named ClassA, objects created from that class has been used in many places. Now you have a requirement that you need to make a simillar class ClassB, which has almost simillar functionality. Objects of ClassA and ClassB will have simillar method signatures, and could be swapable.

26 Jul 2017, 16:13

Using VS Code for Python/Django Development
Visual Studio Code is an editor developed by Microsoft. I have been using this editor for Python development for a few months now. Previously I have been using Pycharm Community Edition for development, but I had to switch to an editor which was less resource consuming than Pycharm, hence I found VS Code.

28 May 2017, 14:35

Play With Pillow
Who hasn’t heard PIL? It’s an image processing library made by python (Python Image Library). Pillow is an extension of it. Installation So installing pillow is really easy: pip install pillow Now we are going to do some image processing cool stuff: First Load Image: from PIL import Image, ImageOps img = Image.

21 Mar 2017, 15:45

Python: Selenium with PhantomJs to capture Screenshots
PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG. And Selenium is a portable software-testing framework for web applications. Selenium provides a record/playback tool for authoring tests without the need to learn a test scripting language (Selenium IDE)

26 Jan 2016, 13:56

Make MacOS Notifications From RSS Feed Using Python
Today we are going to see how make OSX notifications from RSS Feed of any website using Python. So first of all, let us see how to make a simple notification. We are going to use AppleScript for this. Go to terminal and Type: >>osascript -e 'display notification "Lorem ipsum dolor sit amet" with title "Title"' We shall see a notification popping up in right up corner like this:

10 Jan 2016, 15:21

Make .CSV file using MySQL and Python
In this blog, I am going to show how to develop an application by which we can make .csv files from MySQL database using Python. Now, let us start by getting data from Database. Lets say we have a DB names csv_test and it contains a table named test with fields id and name, and for testing purpose let us have some values inserted into it like this:

17 Sep 2015, 21:29

Make a Blog using Django Part 1
Please follow the official tutorial for creating your first django application: “Making a blog using django” - is probably the most made tutorial of Django. This post is no different. But I made this in my own way using some of django’s built-in features so that less coding is required and making it more understandable with minimum packages to use.

17 Sep 2015, 21:15

Change Column Headers in Django Tables 2
Django Tables2 is a package which displays table directly from queryset. It shows column header based on object’s attribute name. But if someone wants to override it, how can he/she do that? Here is a easy solution. Suppose we have a model class like this: class SomeModel(models.Model): somevalue = models.

17 Sep 2015, 21:15

Dynamically constructing filters based on string input using SQLAlchemy
Here I am going to write a dynamic filter. This filter is made for python 3. It will take query or model class and filter condition as input, It will return filtered query based on those filter condition. This is constructed using this SO answer. Function class DynamicFilter(ModelHelper): def __init__(self, query=None, model_class=None, filter_condition=None): super().