Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78071

Re: program to generate data helpful in finding duplicate large files

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.05; 'linux,': 0.07; 'sys': 0.07; 'exit': 0.09; 'posting.': 0.09; 'subject:files': 0.09; 'windows,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '(#1,': 0.16; '2.7.3': 0.16; 'callable': 0.16; 'exit()': 0.16; 'exit.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'interpreter,': 0.16; 'settings,': 0.16; 'subject:program': 0.16; 'typeerror:': 0.16; 'wrote:': 0.18; 'value.': 0.19; 'import': 0.22; 'otherwise,': 0.22; 'cc:addr:python.org': 0.22; 'helper': 0.24; 'settings.': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'script': 0.25; 'header:In- Reply-To:1': 0.27; 'tried': 0.27; 'idea': 0.28; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'sep': 0.31; 'steven': 0.31; 'file': 0.32; '(i.e.': 0.33; '(most': 0.33; 'fri,': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'subject:data': 0.36; 'possible': 0.36; 'clear': 0.37; 'work?': 0.38; 'pm,': 0.38; 'recent': 0.39; 'sure': 0.39; 'how': 0.40; 'back': 0.62; "you'll": 0.62; 'default': 0.69; 'jul': 0.74; 'special': 0.74; 'alone.': 0.84; 'object:': 0.84; '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=U4bdQqMZ4FkwB6XW8WgTleIEersQJZh8nZVjUXaTDt4=; b=DckLj74pt8FRA9NYYRSSAwls0TGSfsVK3ff56JxkQF70t8zu09edBpv1e7ujv1nFPY 5F83ERa7KbSPX34vpH8JmSgk0WG7taef5WX0X9R7m6dUNuUmJZHiIs8HiL7Avtx8eJNs mCq7B3nnAp4VXwwpWet3SUk4MPizOMlYItgQEOJkDndBc7yDBXjmn4P/qtcedE7/O8/N qh/5RF0fpJ805n+G2nL5DUocS+9P/N5BzFADr32WEm9gxhBFFt72XIWd5696nRZSgQdu OQFM8jEl/NcH4umBUE/72idcgWmVTyk9WYTC08AiYkuQ3yyGRt5iUHjKTgYBlJ8nmXeK FsIg==
MIME-Version 1.0
X-Received by 10.50.20.169 with SMTP id o9mr25947663ige.14.1411126597630; Fri, 19 Sep 2014 04:36:37 -0700 (PDT)
In-Reply-To <541c0dc9$0$29992$c3e8da3$5496439d@news.astraweb.com>
References <mailman.14114.1411063879.18130.python-list@python.org> <541bc310$0$29975$c3e8da3$5496439d@news.astraweb.com> <mailman.14135.1411109125.18130.python-list@python.org> <541c0dc9$0$29992$c3e8da3$5496439d@news.astraweb.com>
Date Fri, 19 Sep 2014 21:36:37 +1000
Subject Re: program to generate data helpful in finding duplicate large files
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <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 <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.14142.1411127046.18130.python-list@python.org> (permalink)
Lines 41
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1411127046 news.xs4all.nl 2849 [2001:888:2000:d::a6]:45986
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:78071

Show key headers only | View raw


On Fri, Sep 19, 2014 at 9:04 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
>> Hmm, you sure exit won't work?
>
> In the interactive interpreter, exit is bound to a special helper object:
>
> py> exit
> Use exit() or Ctrl-D (i.e. EOF) to exit
>
> Otherwise, you'll get NameError.

It's not the interactive interpreter alone. I tried it in a script
before posting.

Python 2.7.3 on Linux, 2.6.8 on Linux, 3.5.0ish Linux, 2.7.8 Windows,
2.6.5 Windows, 3.3.0 Windows, and 3.4.0 Windows, all work perfectly,
with (AFAIK) default settings. The only one that I tried that doesn't
is:

C:\>type canIexit.py
import sys
print(sys.version)
print(exit)
print(type(exit))
exit(1)
C:\>python canIexit.py
2.4.5 (#1, Jul 22 2011, 02:01:04)
[GCC 4.1.1]
Use Ctrl-Z plus Return to exit.
<type 'str'>
Traceback (most recent call last):
  File "canIexit.py", line 5, in ?
    exit(1)
TypeError: 'str' object is not callable

I've no idea how far back to go before it comes up with a NameError.
However, this is provided (as is made clear by the type lines) by
site.py, and so can be disabled. But with default settings, it is
possible to use exit(1) to set your return value.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

program to generate data helpful in finding duplicate large files David Alban <extasia@extasia.org> - 2014-09-18 11:11 -0700
  Re: program to generate data helpful in finding duplicate large files Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-19 15:45 +1000
    Re: program to generate data helpful in finding duplicate large files Chris Angelico <rosuav@gmail.com> - 2014-09-19 16:45 +1000
      Re: program to generate data helpful in finding duplicate large files Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-19 21:04 +1000
        Re: program to generate data helpful in finding duplicate large files Chris Angelico <rosuav@gmail.com> - 2014-09-19 21:36 +1000
          Re: program to generate data helpful in finding duplicate large files Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-20 09:33 +1000
            Re: program to generate data helpful in finding duplicate large files Chris Angelico <rosuav@gmail.com> - 2014-09-20 14:47 +1000
    Re: program to generate data helpful in finding duplicate large files Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-19 11:20 -0600
    Re: program to generate data helpful in finding duplicate large files Chris Angelico <rosuav@gmail.com> - 2014-09-20 03:36 +1000

csiph-web