python print end=' '
<p>i have this python script where i need to run 'gdal_retile.py'</p>

<p>but i get this an exception on this line:</p>

<pre><code>if Verbose:
   print("Building internam Index for %d tile(s) ..." % len(inputTiles), end=' ')
</code></pre>

<p>the <code>end=''</code> is invalid syntax just curious as to why.. and what the author probably meant to do. </p>

<p>I'm new to python if you haven't already guessed.</p>

<p>Edit:
<em>Added the opening quote. that was just a typo</em>*</p>

<hr>

<p>I think the root cause of the problem is that these imports are failing
and therefore one must contain this import <code>from __future__ import print_function</code></p>

<pre><code>try: 
   from osgeo import gdal
   from osgeo import ogr
   from osgeo import osr
   from osgeo.gdalconst import *
except:
   import gdal
   import ogr
   import osr
   from gdalconst import *
</code></pre>

<p>Thanks all.</p>
