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

Prasad, Ramit ramit.prasad at jpmorgan.com
Tue May 1 17:35:29 EDT 2012


> > That looks like a tuple which contains five strings.  

> The original choice looks like this when I print it:
> 
> print(choice)
> ('ksals', '', 'alsdkfj', '3', '')

Based on the print statement, choice is a tuple or a string.
try doing `print(type(choice))`. On the assumption it is a 
tuple and not a string you can convert it by doing:

choice = list(choice)

If it actually is a string I would do:
choice = list( ast.literal_eval( choice ) )


Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  


More information about the Python-list mailing list