Search

29 May, 2018

SVN commands you must know as an Test Automation Engineer


In the course of automation and continuous integration , you will someday come across a stage where you have to perform svn operations . And obviously, using command line (forget fancy UIs to do your business) using command line. And then you will have to start digging in,  which will take a substantial amount time ...believe me.

25 May, 2018

How to use argparse module to create command line tools with Python?



Its been decades I have been using sys.argv for simple tasks related to argument parsing. But the thing is, sometimes we don't realize how good something is unless we use it . Like the argparse module.

The official document got me totally confused. So I wrote my own tutorial. Let's get started.

02 May, 2018

Exploring COLLECTIONS module from Python


The 'collections' module has some interesting methods that give us an edge over generic inbuilt tools . I want to explore them here today and show how you can use them .

namedtuple


Tuples are represented as (item1, item2, item2, ...) . They support indexing and one of the ways to use them is :


>>> from collections import namedtuple
>>> Car = namedtuple('Car','Price Mileage Colour Class')
>>> xyz = Car(Price = 100000, Mileage = 30, Colour = 'Cyan', Class = 'Y')
>>> print xyz
Car(Price=100000, Mileage=30, Colour='Cyan', Class='Y')
>>> print xyz.Class
Y

They turn tuples into convenient containers for simple tasks. With namedtuples, you don’t have to use integer indices for accessing members of a tuple.