Re: Programming question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff McNeil

    Re: Programming question

    Have a look at os.listdir and os.stat. I've never worked with 1.5, so
    I don't know what will work with it and what won't,. but I'd imagine
    the following ought to be fine, though.

    stat_list = []
    for dirent in os.listdir('you r_directory'):
    stat_list.appen d(os.stat(diren t))

    Jeff



    On Wed, Jun 11, 2008 at 2:33 PM, Brad Navarro <brad.navarro@w ni.comwrote:
    Greetings,
    >
    >
    >
    Being extremely new to Python, I haven't got the experience to figure this
    one out on my own and frankly I am not sure I would know where to look.
    >
    >
    >
    Basically, what I am trying to do is get a list of each file's attributes
    within a directory. Basically, the information that the 'ls –l' command
    would give you in a linux shell, except the results for each file in the
    directory are stored as a list.
    >
    >
    >
    I am presently using version 1.5 on a linux machine. I have kindly requested
    my system administrator to upgrade to 2.5.2, but until then I am afraid Iam
    stuck with 1.5.
    >
    >
    >
    >
    >
    Thanks,
    >
    Brad
    >
    --

    >
Working...