Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #43046
| References | <4ff75708-f8e4-4ec9-8a4b-e71eb1dc2892@googlegroups.com> |
|---|---|
| Date | 2013-04-08 01:32 -0700 |
| Subject | Re: How to do a Lispy-esque read? |
| From | Benjamin Kaplan <benjamin.kaplan@case.edu> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.272.1365410360.3114.python-list@python.org> (permalink) |
There is no "read in a stream until it's a valid literal" function as far as I know, but ast.literal_eval will turn your string into an object. On Mon, Apr 8, 2013 at 12:45 AM, <zeta.convex@gmail.com> wrote: > Suppose I want to read an object from some stream. How do I do it? > > For example, if the input stream contained the text: > [1, # python should ignore this comment > 2] > > and I do a "read" on it, I should obtain the result > [1, 2] > -- > http://mail.python.org/mailman/listinfo/python-list
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How to do a Lispy-esque read? zeta.convex@gmail.com - 2013-04-08 00:45 -0700 Re: How to do a Lispy-esque read? Barrett Lewis <musikal.fusion@gmail.com> - 2013-04-08 01:17 -0700 Re: How to do a Lispy-esque read? Benjamin Kaplan <benjamin.kaplan@case.edu> - 2013-04-08 01:32 -0700 Re: How to do a Lispy-esque read? Arnaud Delobelle <arnodel@gmail.com> - 2013-04-08 18:46 +0100
csiph-web