Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #90339
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!lightspeed.eweka.nl!lightspeed.eweka.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <ian.g.kelly@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.042 |
| X-Spam-Evidence | '*H*': 0.92; '*S*': 0.00; 'assignment': 0.07; 'subject:code': 0.07; 'exec': 0.09; 'similarly,': 0.16; 'for?': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; '>>>>': 0.31; "can't": 0.35; 'objects': 0.35; 'received:google.com': 0.35; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; "you're": 0.61; '2015': 0.84; 'want:': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=6DO7a1JO9vwuCUVoIgZz2Yjtm0g6CUiRMK8I39k0wR0=; b=KXu7yJX3yjHar3+HIwNcG1lIELq8nsAM1RJ3l5Pbd6iMSZbw3dQhWBu+ghPBLYKcBt Mr0z9yj83EvwrA2JE+SJPt2LHPogz8QVTyFg7ZLHcD5UMlpMQf6p3zxOziWdklzJqw+G V8VS1FKjow8vVTU1PVcqA7xfHbvuDeRZBCQf49HgFDpYTHnmacrbXbFg8eHVLq83nYCg 79Rz8SRu0OFYk20H0RbfTALuuGj41P3ED0uKSsxpyLZcFqb2IR90LZO3xiKPBPKAXel+ sWPgWYNdQQ2HZcvhfNyevkunDBSr0AahWBueOb6E4c5NK+KekT2xroNSmL+YieMuCBwb Aleg== |
| X-Received | by 10.107.12.158 with SMTP id 30mr10079007iom.61.1431315113422; Sun, 10 May 2015 20:31:53 -0700 (PDT) |
| MIME-Version | 1.0 |
| In-Reply-To | <66312d54-de5a-4015-99b5-41d332559e00@googlegroups.com> |
| References | <mailman.49.1430633046.12865.python-list@python.org> <66312d54-de5a-4015-99b5-41d332559e00@googlegroups.com> |
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | Sun, 10 May 2015 21:31:13 -0600 |
| Subject | Re: code blocks |
| To | Python <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.340.1431315116.12865.python-list@python.org> (permalink) |
| Lines | 12 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1431315116 news.xs4all.nl 2947 [2001:888:2000:d::a6]:57798 |
| X-Complaints-To | abuse@xs4all.nl |
| X-Received-Bytes | 3065 |
| X-Received-Body-CRC | 876913337 |
| Xref | csiph.com comp.lang.python:90339 |
Show key headers only | View raw
On Sun, May 10, 2015 at 7:39 PM, zipher <dreamingforward@gmail.com> wrote:
> Similarly, you'd want:
>
>>>> encode(codestr)
>
> to instantiate all objects in the codestr. You can't do this with eval, because it doesn't allow assignment (eval(n=2) returns "InvalidSyntax").
Is exec what you're looking for?
>>> exec('n = 2')
>>> print(n)
2
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
code blocks "Dr. John Q. Hacker" <zondervanz@gmail.com> - 2015-05-02 13:30 -0500
Re: code blocks Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-03 11:56 +0100
Re: code blocks zipher <dreamingforward@gmail.com> - 2015-05-10 18:39 -0700
Re: code blocks Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-10 21:31 -0600
Re: code blocks Rustom Mody <rustompmody@gmail.com> - 2015-05-10 20:40 -0700
Re: code blocks zipher <dreamingforward@gmail.com> - 2015-05-11 08:22 -0700
Re: code blocks zipher <dreamingforward@gmail.com> - 2015-05-11 08:23 -0700
Re: code blocks Chris Angelico <rosuav@gmail.com> - 2015-05-12 01:40 +1000
Re: code blocks Peter Otten <__peter__@web.de> - 2015-05-11 18:01 +0200
Re: code blocks Chris Angelico <rosuav@gmail.com> - 2015-05-12 02:07 +1000
Re: code blocks zipher <dreamingforward@gmail.com> - 2015-05-11 09:51 -0700
Re: code blocks Peter Otten <__peter__@web.de> - 2015-05-11 18:59 +0200
Re: code blocks Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-10 21:36 -0600
csiph-web