Is there a way to use the gdal_contour utility with-in the python console of qgis ? Thank you
Renaud, if you are looking to just make contours and not specifically via the console, look to Nathan W's blog post on the core GdalTools plugin currently available in QGIS:
If you are looking to generate contours via a Python script or PyQGIS plugin, look to these resources:
(QGIS source)/python/plugins/GdalTools/tools/GdalTools_utils.py for functions for finding the gdal binaries and setting up environmental variables.
(QGIS source)/python/plugins/GdalTools/tools/doContour.py for how the user interface for the plugin could be manipulated via Python. You would first trigger() the Raster->Extraction->Contour menu's QAction, then manipulate the shown dialog, eventually clicking OK to start the generation of contours.
svn.osgeo.org/gdal/trunk/autotest/alg/contour.py for how the gdal test suite tests the osgeo.gdal.ContourGenerate() Python binding, which can be used directly in Python code instead of using Python to run the gdal_contours binary.
C public callable GDALContourGenerate(), as a reference when using the above Python binding.
Attempting to generate contours just via the Python console in QGIS would probably be more laborious than writing a script/plugin to do so. If you really need to use the console, Python's subprocess module would probably be the fastest means.