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


Groups > comp.lang.python > #15306

Re: leftover pyc files

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!news2.euro.net!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.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'svn': 0.04; 'scripting': 0.05; 'decent': 0.07; 'git': 0.07; 'subject:files': 0.09; 'am,': 0.12; '*nix': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'windows?': 0.16; 'wrote:': 0.18; 'received:209.85.210.174': 0.18; 'received:mail- iy0-f174.google.com': 0.18; 'delayed': 0.23; 'header:In-Reply- To:1': 0.23; 'string': 0.23; 'variable': 0.24; 'shell': 0.24; 'windows': 0.26; 'exercise': 0.28; 'message-id:@mail.gmail.com': 0.29; "it'd": 0.30; 'recursion': 0.30; "i'll": 0.31; 'nov': 0.31; "isn't": 0.32; 'quite': 0.32; 'to:addr:python-list': 0.32; 'anything': 0.36; 'fri,': 0.36; 'but': 0.37; 'run': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'should': 0.39; "it's": 0.39; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.40; 'really': 0.40; '2011': 0.62; 'enable': 0.65; 'andrea': 0.84; 'nice,': 0.84; 'evaluation.': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ccmqnyWM87Z2ove90Y+qvmYHc0hqMt5UB3xKdHFfQsY=; b=JeD0qLAfIQprYw3myvpihPa7pleYth8yzp7/dUCrfP7us6kqM41waSJPCzlDPvWU4C 5rgl2kCTyx7NgputRUIghKC2G8FsciDHBgqPh/5LAY+pEJxKUVH+Mm5QB+yRzyPcb9E+ b3nQb11svyRNSvEkeGcs084QEC935VwKq12RE=
MIME-Version 1.0
In-Reply-To <4EB2D56C.6070208@gmail.com>
References <4EB14D9D.8080309@gmail.com> <j8rm4k$fvl$1@dough.gmane.org> <mailman.2385.1320248748.27778.python-list@python.org> <11169846.60.1320306575820.JavaMail.geo-discussion-forums@yqiu15> <j8tro3$pj0$1@dough.gmane.org> <4EB2D56C.6070208@gmail.com>
Date Fri, 4 Nov 2011 08:36:15 +1100
Subject Re: leftover pyc files
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2413.1320356178.27778.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1320356178 news.xs4all.nl 6875 [2001:888:2000:d::a6]:52029
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:15306

Show key headers only | View raw


On Fri, Nov 4, 2011 at 4:54 AM, Andrea Crotti <andrea.crotti.0@gmail.com> wrote:
> All these ideas (shell and git hooks) are nice, but unfortunately
> - it's svn not git
> - it's windows not *nix
> - we have to remove only the ones without the corresponding *py...

Windows? Well, Windows shell scripting isn't quite as rich as
bash/csh/etc, but it's possible. I'll leave recursion as an exercise
for the reader, but this (untested) should do it for one directory:

for %d in (*.pyc) do (
set fn=%d
if not exist !fn:~0,-1! del %d
)

This needs to be run with 'cmd /v' to enable delayed variable
evaluation. Of course, it'd be really easy to do if Windows Batch had
anything like decent string manipulation.

ChrisA

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


Thread

Re: leftover pyc files Andrea Crotti <andrea.crotti.0@gmail.com> - 2011-11-02 15:45 +0000
  Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-03 00:49 -0700
    Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-03 00:50 -0700
    Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-03 00:50 -0700
    Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-03 01:45 -0700
    Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-03 01:45 -0700
  Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-03 00:49 -0700
    Re: leftover pyc files Peter Otten <__peter__@web.de> - 2011-11-03 11:51 +0100
    Re: leftover pyc files Andrea Crotti <andrea.crotti.0@gmail.com> - 2011-11-03 17:54 +0000
      Re: leftover pyc files Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-11-04 06:48 +0000
      Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-04 02:27 -0700
        Re: leftover pyc files Andrea Crotti <andrea.crotti.0@gmail.com> - 2011-11-04 10:34 +0000
        Re: leftover pyc files Chris Angelico <rosuav@gmail.com> - 2011-11-04 21:39 +1100
          Re: leftover pyc files 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-04 06:31 -0700
          Re: leftover pyc files 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-04 06:31 -0700
        Re: leftover pyc files Andrea Crotti <andrea.crotti.0@gmail.com> - 2011-11-04 11:00 +0000
        Re: leftover pyc files Terry Reedy <tjreedy@udel.edu> - 2011-11-04 16:01 -0400
          Re: leftover pyc files Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-11-04 23:15 +0000
      Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-04 02:27 -0700
        Re: leftover pyc files Jonathan Hartley <tartley@tartley.com> - 2011-11-04 02:29 -0700
    Re: leftover pyc files Chris Angelico <rosuav@gmail.com> - 2011-11-04 08:36 +1100
    Re: leftover pyc files David Robinow <drobinow@gmail.com> - 2011-11-03 20:14 -0400

csiph-web