By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,965 Members | 1,690 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,965 IT Pros & Developers. It's quick & easy.

What's the difference?

P: n/a
between this:

name = "C"

and this:

name = StringVar()
name.set("C")

I hope someone can explain that to me.

Thanks,

Mitchell Timin

--
"Many are stubborn in pursuit of the path they have chosen, few in
pursuit of the goal." - Friedrich Nietzsche

http://annevolve.sourceforge.net is what I'm into nowadays.
Humans may write to me at this address: zenguy at shaw dot ca
Jul 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Se******@SeeBelow.Nut wrote:
between this:

name = "C"

and this:

name = StringVar()
name.set("C")

I hope someone can explain that to me.

Thanks,

Mitchell Timin


Mitchell,
dir(Tkinter.StringVar) ['__del__', '__doc__', '__init__', '__module__', '__str__', '_default', 'get', 'set', 'trace', 'trace_variable', 'trace_vdelete', 'trace_vinfo'] Tkinter.StringVar.__doc__ 'Value holder for strings variables.' dir("C") ['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__', '__le__',
'__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__str__', 'capitalize', 'center', 'count', 'decode',
'encode', 'endswith', 'expandtabs', 'find', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex',
'rjust', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']

wes

Jul 18 '05 #2

P: n/a
Se******@SeeBelow.Nut wrote:
between this:

name = "C"

and this:

name = StringVar()
name.set("C")

I hope someone can explain that to me.
I couldn't run your code.
name = StringVar()

Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'StringVar' is not defined

Where did you get StringVar from?
Thanks,

Mitchell Timin


--
Shalabh
Jul 18 '05 #3

P: n/a
Se******@SeeBelow.Nut wrote:

between this:

name = "C"

and this:

name = StringVar()
name.set("C")


Now I realize that StringVar is a Tkinter class. You have to import
from Tkinter, and you have to execute Tk() before you can execute
StringVar().

There is more difference than similarity between my two fragments above.

Mitchell Timin

--
"Many are stubborn in pursuit of the path they have chosen, few in
pursuit of the goal." - Friedrich Nietzsche

http://annevolve.sourceforge.net is what I'm into nowadays.
Humans may write to me at this address: zenguy at shaw dot ca
Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.