Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '"this': 0.03; 'open- source': 0.04; 'anyway.': 0.05; 'subject:Python': 0.06; 'debugging': 0.07; "subject:' ": 0.07; 'executed': 0.09; 'interpreted': 0.09; 'latter': 0.09; 'parsed': 0.09; 'salaried': 0.09; 'cc:addr:python-list': 0.11; '23,': 0.16; '24,': 0.16; 'dump': 0.16; 'examples:': 0.16; 'executor': 0.16; 'happily': 0.16; 'renamed': 0.16; 'version"': 0.16; 'subject:python': 0.16; 'weird': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'app': 0.19; 'patrick': 0.19; '(in': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'stick': 0.24; 'tend': 0.24; 'fairly': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'push': 0.26; 'supported': 0.26; 'header:In- Reply-To:1': 0.27; 'idea': 0.28; 'chris': 0.29; 'external': 0.29; 'am,': 0.29; 'url:mailman': 0.30; 'code': 0.31; 'that.': 0.31; 'too.': 0.31; 'easy,': 0.31; 'end,': 0.31; 'so-called': 0.31; 'lists': 0.32; 'there.': 0.32; 'this.': 0.32; 'figure': 0.32; 'languages': 0.32; 'text': 0.33; 'url:python': 0.33; 'guess': 0.33; 'trouble': 0.34; 'core': 0.34; "can't": 0.35; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'tech': 0.36; 'url:listinfo': 0.36; 'doing': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'throughout': 0.37; 'message- id:@gmail.com': 0.38; 'problems': 0.38; 'convention': 0.38; 'nov': 0.38; 'window': 0.38; 'anything': 0.39; "couldn't": 0.39; 'enough': 0.39; 'major': 0.40; 'url:mail': 0.40; 'skip:u 10': 0.60; 'expression': 0.60; 'most': 0.60; 'free': 0.61; 'break': 0.61; 'simple': 0.61; "you're": 0.61; 'header:Message-Id:1': 0.63; 'hear': 0.63; 'kind': 0.63; 'love': 0.65; 'to:addr:gmail.com': 0.65; 'between': 0.67; 'natural': 0.68; 'live,': 0.68; 'secure': 0.71; 'day': 0.76; 'glad': 0.83; '2014,': 0.84; 'all;': 0.84; 'distinguish': 0.84; 'i\xe2\x80\x99ll': 0.84; 'underneath': 0.84; 'aka': 0.91; 'obvious,': 0.91; 'examine': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/wf0OfUapnt7MZ3NPfAUFlQokSwq6UW8PtCIeH9Xdr8=; b=JQpz9k7SvxcRlcmx4rzQlNMzTrwp04s7BSRpBCmc9c4iWqS/InJHloPgonXJLOJDab nlx/EoQFgeYN2qY/oCxXQ22mfV4KeeGlxY2Tal98NqMfSoWZ0ew3DWkfFKXI4p22ANoa YOYha2bicVMbY0nHYRFM3zmKryMqV/xm4TgV2O0BNhsH/vSU+fw9Ys2dBzRGmmTwQiCV Z2PVJwQbX6WeNZvFUoJ91aRGekd9uJUrLDYhm0ZIeSWn8PUCFLJs5Da6IvUJLZuFJwUJ sg0RpMnXtqiLFENmF/lQboFYNn5Pj1dGHVul4EIYbkjNd4B/hqVpXxyWhrtE5zKarg5Q hU/Q== X-Received: by 10.66.165.200 with SMTP id za8mr41113394pab.156.1416901130441; Mon, 24 Nov 2014 23:38:50 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: Embedded python 'scripting engine' inside Python app From: Patrick Stinson In-Reply-To: Date: Mon, 24 Nov 2014 22:38:48 -0900 Content-Transfer-Encoding: quoted-printable References: <05D7659F-9D0B-466B-833E-8454DCF0F57A@gmail.com> <0B2C4A0D-401C-446E-9EE6-C04791F904DB@gmail.com> To: Chris Angelico X-Mailer: Apple Mail (2.1993) Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 60 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416901139 news.xs4all.nl 2932 [2001:888:2000:d::a6]:58430 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81492 > On Nov 23, 2014, at 4:57 AM, Chris Angelico wrote: >=20 > On Mon, Nov 24, 2014 at 12:20 AM, Patrick Stinson = wrote: >> I think this is the way I=E2=80=99ll take it, and for all the same = reasons. The only way they can break it is if they really want to. I = guess anything other Franken-apps would be interesting to hear about = too. And I=E2=80=99ll still stick it on the app store. >>=20 >=20 > (Please note, the convention on this list/newsgroup - as with most > tech lists - is to put your text underneath what you're quoting - > so-called "bottom-posting" or "interleaved" style.) >=20 > Yep. I got in some trouble for doing this at my last salaried > employment, because the boss couldn't get his head around the idea > that an XKCD 936-compliant password is secure enough for a code > executor, and that the absence of a code executor makes debugging much > harder. (In the end, I just renamed it to "calculator" so it wasn't so > obvious, and left it there. Debugging is important.) In my open-source > MUD client, Gypsum, there's a code executor built-in, which I use > regularly as a simple calculator, and also to manipulate the program's > internals. Some examples: >=20 >> /x 123+456*789 > 359907 >> /x asin(.5)*180/3.14159 > 30.0000253399374 >> /x "Test "*5 + "Haha" > "Test Test Test Test Test Haha" >> /x window.mainwindow.iconify() > GTK2.Window > (and the main window has just been minimized, aka iconified) Thanks for the stories in this and the other thread. I love these = interesting problems that push the limits :) >=20 > Basically, any expression that I type after "/x" will be parsed and > executed as code. There's no sandboxing at all; it's executed in its > own globals() and locals(), but if it wants to tinker with external > state, it's free to do that. Since all the code is there for the user > to peruse anyway, I don't distinguish between "this you may do" and > "this you may not do", but instead between "this is pledged to be > supported throughout this major version" and "this is undocumented, > use at your own risk" - on the understanding that most of the latter > category is actually pretty stable, and can happily be used anyway. >=20 > Interpreted languages tend to make this kind of thing fairly easy, and > on the day you have a weird error that you can't figure out, you will > be no end of glad you have this. No triggering a core dump and then > doing a post-mortem, just examine state live, using the language's > natural syntax. >=20 > ChrisA > --=20 > https://mail.python.org/mailman/listinfo/python-list