Dammit, been awake too long researching on the Internet, but I finally
reached the Last Page
On Thu, Dec 1, 2011 at 3:25 PM, Ben Finney wrote:
> Steven D'Aprano writes:
>
>> On Wed, 30 Nov 2011 17:12:10 -0500, Terry Reedy wrote:
>>
>> > I think it would be better if safe_eval were available as a
Steven D'Aprano writes:
> On Wed, 30 Nov 2011 17:12:10 -0500, Terry Reedy wrote:
>
> > I think it would be better if safe_eval were available as an easily
> > accessible builtin and dangerous_eval were tucked away in a module ;-).
>
> +10
You do realise that any vote outside the range −1 thr
On Wed, 30 Nov 2011 17:12:10 -0500, Terry Reedy wrote:
> I think it would be better if safe_eval were available as an easily
> accessible builtin and dangerous_eval were tucked away in a module ;-).
+10
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On 11/30/11 16:48, Hidura wrote:
Why you don't make this "['1','2','3']".strip("[]").split(',') work for me
because it breaks on things like
s = """
[[1,2,3],42,'''triple the fun!''', "can't touch this,
eh?",r'"Back\\\slashes?!", she said.', [4,5,6]]
"""
Commas can be embedded in
On 11/30/2011 5:48 PM, Hidura wrote:
Why you don't make this "['1','2','3']".strip("[]").split(',') work for me
Look more carefully. This is not the same as ast.literal_eval().
>>> "['1','2','3']".strip("[]").split(',')
["'1'", "'2'", "'3'"] # list of 3-char strings
>>> ast.literal_eval("['
Why you don't make this "['1','2','3']".strip("[]").split(',') work for me
El nov 30, 2011 10:16 p.m., "Terry Reedy" escribió:
> On 11/30/2011 3:58 AM, Peter Otten wrote:
>
>> Terry Reedy wrote:
>>
>> On 11/30/2011 1:20 AM, 郭军权 wrote:
>>>
Good after
I have a string liststr = '["","
On 11/30/2011 3:58 AM, Peter Otten wrote:
Terry Reedy wrote:
On 11/30/2011 1:20 AM, 郭军权 wrote:
Good after
I have a string liststr = '["","","ccc"]' ,and I need convert it
to a list like list = ["","","ccc"],what can id do?
The easiest -- and most dangerous -- way is
>>> ev
Terry Reedy wrote:
> On 11/30/2011 1:20 AM, 郭军权 wrote:
>> Good after
>> I have a string liststr = '["","","ccc"]' ,and I need convert it
>> to a list like list = ["","","ccc"],what can id do?
>
> The easiest -- and most dangerous -- way is
> >>> eval('["","","ccc"]')
> ['
Arnaud: Already showed that solution
On Wed, Nov 30, 2011 at 6:09 PM, Arnaud Delobelle wrote:
>
> On Nov 30, 2011 6:21 AM, "郭军权" wrote:
>>
>> Good after
>> I have a string liststr = '["","","ccc"]' ,and I need convert
>> it to a list like list = ["","","ccc"],what can id do?
On Nov 30, 2011 6:21 AM, "郭军权" wrote:
>
> Good after
> I have a string liststr = '["","","ccc"]' ,and I need
convert it to a list like list = ["","","ccc"],what can id do?
> Thanks.
>
Look up the json module.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
On 11/30/2011 1:20 AM, 郭军权 wrote:
Good after
I have a string liststr = '["","","ccc"]' ,and I need convert it
to a list like list = ["","","ccc"],what can id do?
The easiest -- and most dangerous -- way is
>>> eval('["","","ccc"]')
['', '', 'ccc']
But DO NOT eva
import json
s = json.dumps([1, 2, 3, 4])
# '[1, 2, 3, 4]'
l = json.loads(s)
# [1, 2, 3, 4]
2011/11/30 郭军权 :
> Good after
> I have a string liststr = '["","","ccc"]' ,and I need convert
> it to a list like list = ["","","ccc"],what can id do?
> Thanks.
>
>
> --
> 郭军权
> 清华大学网络中
Good after
I have a string liststr = '["","","ccc"]' ,and I need convert
it to a list like list = ["","","ccc"],what can id do?
Thanks.
--
郭军权
清华大学网络中心网络安全实验室
guojunquan{at}gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
13 matches
Mail list logo