Moving a String to a StringVar

07-28-2016 09:49 AM
New Contributor II

I am using the Entry Widget. In it I have:

global HoldString

HoldString = StringVar()


Later I want the HoldString to have the value of a string that was made earlier like:

abc = "asdadad"



just gives me a cryptic   PY_VAR0 when I try to print the value of HoldString

It seems I can only set it to a literal like HoldString("asdadad")

Is there anyway move the value of a string to a StringVar?


0 Kudos
2 Replies
MVP Esteemed Contributor


This doesn't appear to be directly a python problem... what are you using this in? perhaps a share there would be best.

New Contributor II

OK, here is the whole shebang. For ArcGIS I am making a GUI to do importing of layers.

The code uses ttk.Entry Widgets


My program ( that is attached) uses Entry Widget to display the pathname to files (using tkFileDialog.askopenfilename)

But the Entry requires a textvariable being equal to a StringVar() and I cannot get the pathname I picked up to load the name.)

The black part of the JPG above is it printing what was displayed in the Entry box, but when it transferred the string to the StringVar for each of then it printed '<bound method StringVar.get of <Tkinter.StringVar instance...>>

The GeoScrip01 window is created by for input of the two pathnames via two buttons, plus a Clear button, Submit Job button, and Quit.

It won't give me 'C:/Users/phacker/Documents/ArcGIS/FAKEINPUT/counties.txt'

I need that pathname (and others) to load GIS information later in the program.



0 Kudos