Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'attributes': 0.07; 'subject:question': 0.08; 'tuple': 0.09; 'aug': 0.13; 'size,': 0.13; '(note': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'helps!': 0.16; 'instance:': 0.16; 'notably': 0.16; 'wrote:': 0.17; 'thu,': 0.17; '>>>': 0.18; 'windows': 0.19; 'sort': 0.21; 'import': 0.21; 'received:209.85.214.174': 0.21; 'help.': 0.22; 'testing': 0.24; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'all.': 0.28; 'dictionary': 0.29; 'class': 0.29; "i'm": 0.29; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'text': 0.34; 'thanks': 0.34; 'list': 0.35; 'so,': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'received:209': 0.37; 'far': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'some': 0.38; 'things': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'header:Received:5': 0.40; 'help': 0.40; "you'll": 0.62; '30,': 0.62; 'is.': 0.62; 'box,': 0.69 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:to :content-type; bh=kouXp0RpWAy2wNhnO7s1EFH5ixh3Y20VucAlax0UpB0=; b=eRC2yonB41VpKxZfmm84UEYfbJjjlAn3bddvk3xSsBWC8lUx0oHZt4UNx5NEzxFu3i 3up7QOlivjFFziNOunWeHSncKRuWKBHa2arvZrFVaYP5NzbUvCI0VEy62wNmFCCIh36L NAejazzyE6o2nhKCede+zRkGihCDpizYCFrqkydA4I6ZOPLngzLmMQBPUuMXBYIoP7JJ g3CrPDF4O295ZBZKq9/Bz2bvnQEpu/kTozQlPx1W+Ic0naZrUx7sUlqo/y8HRBxLquvY mi82tfoRiEcKmU6uAAmyLR2zzNMK+Tqv2met13mndq0n8T3z+Xjr4ucOdYpHNXzdpuhl dG1w== MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 30 Aug 2012 22:32:18 +1000 Subject: Re: Beginners question From: Chris Angelico 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346329941 news.xs4all.nl 6903 [2001:888:2000:d::a6]:39620 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28108 On Thu, Aug 30, 2012 at 9:54 PM, wrote: > What sort of object is posix.stat_result? Its not a dictionary or list or a > class object as far as I can tell. Thanks for any help. There's some cool things you can do here. (Note that I'm testing this on a Windows box, so it's marginally different.) >>> import os >>> st=os.stat(".") >>> st nt.stat_result(st_mode=16895, st_ino=36873221949168842, st_dev=0, st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1346329853, st_mtime=1311543704, st_ctime=1306188101) >>> help(st) You'll get a couple of pages of help text about the object class that the stat object is. You can do this with any object at all. Notably in this case: | This object may be accessed either as a tuple of | (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime) | or via the attributes st_mode, st_ino, st_dev, st_nlink, st_uid, and so on. So, for instance: >>> st[0] 16895 >>> st.st_mode 16895 Hope that helps! ChrisA