newbie - variable "buried in quotes"

Peter Hansen peter at engcorp.com
Mon May 16 12:54:16 EDT 2005


plsullivan wrote:
> I've got a variable deep inside some quotes needed by the application I
> am using. I can't figure out how to make this work. (Also, is there a
> line continuation character?)
> Thanks in advance,
> Phil
> 
> luser = win32api.GetUserName()
> 
> gp.FeatureclassToCoverage_conversion("'Database
> Connections\\%s at GIS_srv-earth.sde\\GIS.GIS.Cadastral\\GIS.GIS.Parcels'
> POLYGON", prcl83, "", "DOUBLE") % luser

The % operator goes immediately after the string on which it operates:

gp.FeatureclassToCoverage_conversion("'Database
Connections\\%s at GIS_srv-earth.sde\\GIS.GIS.Cadastral\\GIS.GIS.Parcels'
POLYGON" % luser, prcl83, "", "DOUBLE")


-Peter



More information about the Python-list mailing list