newbie question
Matt Wheeler
m at funkyhat.org
Thu Mar 24 06:57:40 EDT 2016
More information about the Python-list mailing list
Thu Mar 24 06:57:40 EDT 2016
- Previous message (by thread): newbie question
- Next message (by thread): newbie question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>>> import ast >>> s = "(1, 2, 3, 4)" >>> t = ast.literal_eval(s) >>> t (1, 2, 3, 4) On 24 March 2016 at 10:39, ast <nomail at com.invalid> wrote: > Hi > > I have a string which contains a tupe, eg: > > s = "(1, 2, 3, 4)" > > and I want to recover the tuple in a variable t > > t = (1, 2, 3, 4) > > how would you do ? > > > -- > https://mail.python.org/mailman/listinfo/python-list -- Matt Wheeler http://funkyh.at
- Previous message (by thread): newbie question
- Next message (by thread): newbie question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list