Detect ipython console width

For ipython I use this to detect console line width :

ncols =  int(os.getenv('COLUMNS', 80))