Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'interpreter': 0.05; 'url:pipermail': 0.05; 'subject:Python': 0.06; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'unpacking': 0.16; 'files.': 0.16; 'wrote:': 0.18; 'module': 0.19; 'import': 0.22; 'header:User-Agent:1': 0.23; 'driver': 0.24; 'file.': 0.24; 'script': 0.25; 'compiled': 0.26; 'distribute': 0.26; 'excel': 0.26; 'header:X-Complaints-To:1': 0.27; 'possibility': 0.29; 'code': 0.31; 'that.': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'subject:end': 0.31; 'subject:users': 0.31; 'file': 0.32; 'option': 0.32; 'another': 0.32; 'url:python': 0.33; 'subject:from': 0.34; 'but': 0.35; 'possible': 0.36; 'url:org': 0.36; 'should': 0.36; 'to:addr:python-list': 0.38; 'files': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'users': 0.40; 'url:mail': 0.40; 'here:': 0.62; 'such': 0.63; 'zip': 0.64; 'subject:source': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Sturla Molden Subject: Re: Obscuring Python source from end users Date: Mon, 29 Sep 2014 14:51:33 +0000 (UTC) References: <89381545-5edc-4f85-a4b8-86eebfdf34ee@googlegroups.com> <542946ec$0$12998$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 60-109-11.connect.netcom.no User-Agent: NewsTap/4.0.1 (iPad) X-: 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1412002310 news.xs4all.nl 2909 [2001:888:2000:d::a6]:60078 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:78467 Steven D'Aprano wrote: > Another possibility is to distribute your modules inside a zip file. See > here: > > https://mail.python.org/pipermail/python-list/2014-July/675506.html > > Such zip files are not just runnable, but also importable. Depending on your > Excel requirements, you might need a tiny driver script as above. It should also be possible to temper with the zipimport module to allow a 'scrambled' zip file. That makes it harder for users to access the code by unpacking the zip file. py2exe will collect pyc files into a single zip file and import that. It does not need a driver script because it embeds the Python interpreter in an executable. Yet another option is to compile the Python code with Cython and distribute everything as compiled pyd files. Sturla