Python reduce function

Share

This is an interesting short cut function when you want to process list items recursively. This function takes two arguments in as input, one function name that you want to apply on list and second the list itself. In python3 reduce is available in func_tools module. Typical syntax to invoke this is reduce(function_name, list_of_items) and […]

Python map function

Share

Think of a situation, where you want to perform same operation on a group of objects. For eg, you want to run same commands on a family of network devices. Traditionally, to achieve this you have to iterate device objects one by one and then apply required function to run commands on devices. In python, […]

Lambda functions in python

Share

Traditionally, most programmers use functions and macros to write re-usable routines. In Python there is a simple way write quick one liner functions which can be used throughout your program. Lambda functions are also known as anonymous functions. Syntax of lambda function is like: Here are few examples. A few more practical use cases to […]

Getting CCTV streams in Python

Share

I have basic CCTV setup at home with two bullet cameras on 4 channel hikvision DVR. Hikvision DVR does not offers face detection, vehicle detection or any other image processing functions with basic cameras. I thought it will be worth to get CCTV feeds in python and then do try out face detection etc on […]

Starting with Python django

Share

Django is a open source and free python based framework for web programming. I have used python3 and django 2.1.7 on debian 9.8 in this article to write a basic django based web app. Install django Create a directory to hold are your development stuff “django-works” or whatever name you like. Create your first django […]