[prev in list] [next in list] [prev in thread] [next in thread]
List: python-list
Subject: Re: newbie question
From: Matt Wheeler <m () funkyhat ! org>
Date: 2016-03-24 13:22:13
Message-ID: CAG93HwH92bQGN57h_L6W8DgSDXRWW48Ojtws1Hex9FrXjfPveQ () mail ! gmail ! com
[Download RAW message or body]
On Thu, 24 Mar 2016 11:10 Sven R. Kunze, <srkunze@mail.de> wrote:
> On 24.03.2016 11:57, Matt Wheeler wrote:
> >>>> import ast
> >>>> s = "(1, 2, 3, 4)"
> >>>> t = ast.literal_eval(s)
> >>>> t
> > (1, 2, 3, 4)
>
> I suppose that's the better solution in terms of safety.
>
It has the added advantage that the enquirer gets to import a module that
shares their name ;)
>
--
https://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic