Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.05; 'python': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'languages.': 0.15; '(mainly': 0.16; 'from:addr:behnel.de': 0.16; 'from:addr:stefan_ml': 0.16; 'from:name:stefan behnel': 0.16; 'html)': 0.16; 'ignores': 0.16; 'java.': 0.16; 'message- id:@dough.gmane.org': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'stefan': 0.17; 'code.': 0.20; 'fairly': 0.21; 'java': 0.21; 'properties': 0.24; 'script': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'tree': 0.27; 'interface': 0.27; "doesn't": 0.28; 'header:X-Complaints- To:1': 0.28; 'lines': 0.28; 'this?': 0.28; 'whitespace': 0.29; 'included': 0.29; 'source': 0.29; "i'm": 0.29; 'received:84': 0.32; 'comments': 0.33; 'to:addr:python-list': 0.33; 'project': 0.34; 'received:org': 0.36; 'tool': 0.36; 'subject: (': 0.36; 'subject:: ': 0.38; 'files': 0.38; 'comment': 0.38; 'easier': 0.38; 'fact': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'easy': 0.60; 'most': 0.61; 'containing': 0.61; 'counts': 0.81; 'received:arcor-ip.net': 0.84; 'received:pools.arcor-ip.net': 0.84; 'subject:proposition': 0.84; 'subject:source': 0.84; 'you).': 0.95 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Stefan Behnel Subject: counting source lines (was: Is Python a commercial proposition ?) Date: Sun, 29 Jul 2012 19:49:51 +0200 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: dslb-084-056-052-116.pools.arcor-ip.net User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 1343584207 news.xs4all.nl 6927 [2001:888:2000:d::a6]:60661 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:26203 lipska the kat, 29.07.2012 18:01: > My most recent experience is with Java. The last project I was involved > with included 6775 java source files containing 1,145,785 lines of code. > How do I know this? because I managed to cobble together a python script > that walks the source tree and counts the lines of code. It ignores block > and line comments and whitespace lines so I'm fairly confident it's an > accurate total. It doesn't include web interface files (mainly ..jsp and > HTML) or configuration files (XML, properties files and what have you). In > fact it was remarkably easy to do this in python Just a comment on this part. An even easier way to count source lines is by using the tool "SLOCCount". It also works with various languages. Stefan