In this post I will be describing how to generate subsets of a list / array programmatically. The code will be in python version. There are two ways to generate subsets Method 1 One elegant way to go through all subsets of a set is to use recursion. Let’s consider a list or superset [1,Continue reading “How to Generate Subsets”
Category Archives: Python
Make Your Application default in Web2py
Hey are you thinking how to make your web2py application as default application when you run python web2py.py. Here is something that you can do. There are different ways of doing this 1.Rename your application to init, set your controller as default and the controller function to index If you don’t want your application’s startingContinue reading “Make Your Application default in Web2py”
Understanding Python Unit Testing Framework
The Python Unit Testing Framework PyUnit is a python language version of JUnit. The basic building blocks of unit testing are ‘test cases’ — single scenarios that must be set up and checked for correctness. In PyUnit, test cases are represented by the TestCase class in the unittest module. To make your own test casesContinue reading “Understanding Python Unit Testing Framework”
Understanding Python Glob Library
I think besides of coding understanding a code may also be needed for a programmer.So i am here discussing about a library called glob in python. glob is a python module and can be found in /usr/lib/python2.6.it finds all the pathnames matching a specified pattern according to the rules used by the Unix shell.No tildeContinue reading “Understanding Python Glob Library”
PROGRAMMING IN PYTHON
I have been dabbling in Python for a couple of days now, read the online docs/tutorial and started playing with Python a bit as well…..and I feel like I am a “BIG ZERO” in python.Most everything I see is generally encapsulated in a single script or so large and unwieldy I don’t know where toContinue reading “PROGRAMMING IN PYTHON”