Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!hq-usenetpeers.eweka.nl!hq-usenetpeers.eweka.nl!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!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.018 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:Python': 0.06; 'automate': 0.07; 'debugging': 0.07; "subject:' ": 0.07; 'augmented': 0.09; 'feature,': 0.09; 'cc:addr:python-list': 0.11; '23,': 0.16; 'dict': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'symbols': 0.16; 'think.': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'basically': 0.19; 'patrick': 0.19; 'separate': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'script': 0.25; 'push': 0.26; 'header:In-Reply- To:1': 0.27; 'feature': 0.29; 'message-id:@mail.gmail.com': 0.30; 'reply.': 0.31; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'thanks': 0.36; 'possible': 0.36; 'nov': 0.38; 'process,': 0.38; 'pm,': 0.38; 'skip:p 20': 0.39; 'users': 0.40; 'even': 0.60; 'no.': 0.61; 'simply': 0.61; 'pick': 0.64; 'more': 0.64; 'great': 0.65; 'effectively': 0.66; 'secure': 0.71; 'lack': 0.78; 'dict.': 0.84; 'embrace': 0.84; 'clearing': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=QLX9HSZK8N8ICFBnGgO6A6pDIlpYlL3JOP7mi+TEqRY=; b=c3jSluCqJmKY/vT3O+g5KkBT5E1X/E/wnVmDjwsbHYeveN3/4e6SQuR3T3yNO2h6MN ET7fbbPCmNMtlmSYSbEtDUOagXIlzqf8Cx3r+5WOzey8hmdJqlRQ62vxZvbeikS/r9K2 tlhzkbzhaoRDBjDK8lunxX1aH/5cHtScFFWeqS5/y3d/5aCv55QjGR2LUvA+IYHy7VKQ pbJGBQY0R3jBmf4+kSQ90knlCNDpZ4MwouGvavrKFxA94GMZNg/3csFT3Ed9EDhK0V4V 6wpLWA+GwasAK8OGPpuodXMNQUpEfadAQ0+MTCWazfLeEsPWbGoM43wjoGwZYxG/Hyhx RCCQ== MIME-Version: 1.0 X-Received: by 10.107.17.79 with SMTP id z76mr12770191ioi.27.1416738952917; Sun, 23 Nov 2014 02:35:52 -0800 (PST) In-Reply-To: <0B2C4A0D-401C-446E-9EE6-C04791F904DB@gmail.com> References: <05D7659F-9D0B-466B-833E-8454DCF0F57A@gmail.com> <0B2C4A0D-401C-446E-9EE6-C04791F904DB@gmail.com> Date: Sun, 23 Nov 2014 21:35:52 +1100 Subject: Re: Embedded python 'scripting engine' inside Python app From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416738955 news.xs4all.nl 2944 [2001:888:2000:d::a6]:59347 X-Complaints-To: abuse@xs4all.nl X-Received-Body-CRC: 1597711564 X-Received-Bytes: 4217 Xref: csiph.com comp.lang.python:81358 On Sun, Nov 23, 2014 at 9:28 PM, Patrick Stinson wrote: > Thanks for your great reply. I even augmented the reloading with the same > dict by clearing all of the non-standard symbols from the dict. This > effectively resets the dict: You may as well start with an empty dict and then pick up the few things you want, I think. > Is there a better and more secure way to do the python-within-python in > order allow users to automate your app? More secure? Basically no. You could push the inner script into a separate process, but I would recommend simply acknowledging the insecurity. Embrace the lack of security and call it a debugging feature - make it possible to introspect, control, manipulate internal structures. Feature, not flaw. :) ChrisA