Ciao a tutti! ho un problema con subprocess e le stringhe... in particolare devo lanciare con subprocess il seguente comndo di GRASS[0] da shell:
$ v.extract input="oroads" layer="1" where="cls='very_low'" output="oroads_very_low" --o il problema nasce con l'opzione "where" che รจ una stringa che contiene una stringa... >>> key = "where" >>> value = "cls='very_low'" >>> """%s=%s""" % (key, value) "where=cls='very_low'" >>> """%s=%r """ % (key, value) 'where="cls=\'very_low\'"' sia utilizzando %s=%s che con %s=%r il comando non viene interpretato correttamente da GRASS, come posso fare per avere: >>> """%?=%? """ % (key, value) """where="cls='very_low'" """ Ho cercato in internet ma non sono stato capace di trovare la soluzione... idee? Grazie per l'aiuto. Pietro [0] http://grass.osgeo.org/gdp/html_grass70/v.extract.html _______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python