[Qgis-developer] New Python API , "modernity" and Python 2.6.x

gene martin.laloux at gmail.com
Sat Jun 15 05:27:26 PDT 2013


Thanks Nathan, I am not a GitHub professional. I realize now that the 
correct formulation is (it is a detail):

  Python {0} on {*1*}\n

As In my work, I must use multiple versions of Python according to users
(from 2.6 to 3.3), I use simple correspondences between them (in fact, for a
Python programmer, there is no great differences between the 2.6.x and the
2.7.x versions, except ease-of-use.  The 3.x version is other thing, but no
more difficult)

Some examples:

    in Python 2.7.x : {i: line_string for i, line_string in
enumerate(line_strings)}
    in Python 2.6.x : dict((i, line_string) for (i, line_string) in
enumerate(line_strings))

    in Python 2.7.x : {collection.name: collection or collection in
collections}
    in Python 2.6.x : dict((collection.name,collection)) for collection in
collections})

   in Python 2.7.x : ['+{}={}'.format(k, v) for k, v in
geom.proj4_params.iteritems()]
   in Python 2.6.x : ['+{0}={1}'.format(k, v) for k, v in
geom.proj4_params.iteritems()]

So, If I encounter other problems,  I would point you to the solutions.

And congratulations for the geom.exportToGeoJSON() (now we can use the
geo_interface (GeoJSON-like) protocol of Sean Gillies (see  PyShp as Fiona
(with the GeoJSON-like protocol)
<https://github.com/mlaloux/PyShp-as-Fiona--with-geo_interface->  ))




--
View this message in context: http://osgeo-org.1560.x6.nabble.com/New-Python-API-modernity-and-Python-2-6-x-tp5060306p5060333.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.


More information about the Qgis-developer mailing list