Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4a.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.042 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'subject:file': 0.07; '22,': 0.09; 'modulo': 0.09; 'python:': 0.09; 'python': 0.11; 'subject:python': 0.16; 'wrote:': 0.18; 'seems': 0.21; 'cheers,': 0.24; 'file.': 0.24; 'nearly': 0.26; 'distribute': 0.26; 'header :In-Reply-To:1': 0.27; 'function': 0.29; 'chris': 0.29; 'feature': 0.29; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'file': 0.32; 'quite': 0.32; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'url:org': 0.36; 'application': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'little': 0.38; 'to:addr:python.org': 0.39; 'called': 0.40; 'users': 0.40; 'zip': 0.64; 'jul': 0.74; '(probably': 0.84; 'sender:addr:chris': 0.84; 'url:latest': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=MszGyLMtkn7L02QGZ9ikj/C6dI7ljZVq+KUQNKH5UcE=; b=L2S6VQuldfpxn62vW6ex9uzIjYVtJPg1nKxQHzyOWRrgtWAOYGpghbPkxxlLtxtHn8 fciP68acR4dhgTWMqPEAv37vvSfTYD1j8o2UDcdQdQBVMKFv6aufwzkLxnh3zZ3+QlgB 2CcEQkyr5zTRTADQVPh8oVnOery/MSf2ZoE/g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=MszGyLMtkn7L02QGZ9ikj/C6dI7ljZVq+KUQNKH5UcE=; b=ThUm54P7oTNBrPjltWwobmsWq+30Jj5Y+TDmK6jJmQuI23Hdz6unhh1iOXGhT0o+ML I/CVj+9DGkxglW2XLcMp+0Ddb0gqUW74XqpuA0Mx8U+jOBL1RwVBDcMBJ/3qq3cEL1FV Kc60ZlU0x311o8aVC3bmY6hpUwxTtyd0rml6lFoI0WlW1PFGAQknNKImIYz8SZ/WtMM7 wlwX7gZ9QId6q9dmBAsvhIYooU/ZZok2t4MjYHNBZAsmsajre2NIbADjDtsoFFQALNiH +SHiThyJwkpc3LdDNCFxLtM3PciwY0CqxOtxJv1lZeI3FP0eRj1CO1dDql48k6awiwYM +ABg== X-Gm-Message-State: ALoCoQltE5Sd1CFlhxYRbvqtlQyxpJJsW0mgNF2iOwQjVXaQk7Cd1B4g9Qk2QmPGt1vF5+NSZOt9 MIME-Version: 1.0 X-Received: by 10.42.62.6 with SMTP id w6mr34529091ich.24.1406094378311; Tue, 22 Jul 2014 22:46:18 -0700 (PDT) Sender: chris@rebertia.com In-Reply-To: <53cf38c2$0$29897$c3e8da3$5496439d@news.astraweb.com> References: <53cf38c2$0$29897$c3e8da3$5496439d@news.astraweb.com> Date: Tue, 22 Jul 2014 22:46:18 -0700 X-Google-Sender-Auth: mteLTjf1bingWTMz6kmxbT7oI1A Subject: Re: Distributing python applications as a zip file From: Chris Rebert To: Python 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1406094386 news.xs4all.nl 2838 [2001:888:2000:d::a6]:43131 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75058 On Tue, Jul 22, 2014 at 9:23 PM, Steven D'Aprano wrote: > A little known feature of Python: you can wrap your Python application in > a zip file and distribute it as a single file. The trick to make it > runnable is to put your main function inside a file called __main__.py > inside the zip file. > It's not quite self-contained, as you still need to have Python > installed, but otherwise it's a good way to distribute a Python > application as a single file that users can just copy and run. And if you want something nearly completely self-contained (probably modulo dynamic linking), it seems that there's PEX (http://pex.readthedocs.org/en/latest/ ). Cheers, Chris