Converting a string to list for submission to easygui multenterb​ox

Cameron Simpson cs at zip.com.au
Tue May 1 19:29:34 EDT 2012


Disclaimer: I have never used esygui.

On 01May2012 21:29, John Gordon <gordon at panix.com> wrote:
| In <3b5f65c4-cd95-4bb4-94f2-0c69cf2b1a80 at d20g2000vbh.googlegroups.com> ksals <kbsals5179 at gmail.com> writes:
| > The original choice looks like this when I print it:
| 
| > print(choice)
| > ('ksals', '', 'alsdkfj', '3', '')

That's just print() printing a tuple.

| > I need to submit these as defaults to a multenterbox. Each entry above
| > ksals, "", "alsdkfj', 3 , '' need to fill the five fields in the box.
| > I tried your suggestion so you must be right it is a tuple of 5
| > strings.  But I need them to work in an instruction like
| > fieldValues =3D eg.multenterbox(msg1,title, fieldNames, choice)
| > fieldNames has 5 fields.
| 
| If you just need to convert a tuple to a list, that's easy. Call the
| built-in function list() and pass the tuple as an intializer:

Supposedly he should not need to. From:

  http://www.ferg.org/easygui/tutorial.html#contents_item_10.2

the sentence: "The choices are specified in a sequence (a tuple or a
list)."

I do not believe that ksals needs to change anything.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Uh, this is only temporary...unless it works.   - Red Green



More information about the Python-list mailing list