newbie - insert variable in pathname

P

plsullivan63

Hello all,
I have a username variable luser:

luser = win32api.GetUserName

I need to insert it into the following to replace the hardcoded
"johndoe" in the pathname of GIS.GIS.Parcels:

GIS_GIS_Parcels = "Database
Connections\\johndoe@GIS_srv-earth.sde\\GIS.GIS.Cadastral\\GIS.GIS.Parcels"

Thanks in advance,
plsullivan
 
M

Miradan

import win32api

GIS_GIS_Parcels = "Database
Connections\\%s@GIS_srv-e­arth.sde\\GIS.GIS.Cadastral\\G­IS.GIS.Parcels"
% (win32api.GetUserName())

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,239
Messages
2,571,199
Members
47,835
Latest member
CyrusRuggi

Latest Threads

Top