Re: [Matplotlib-users] Saving to a file in a specified directory (and creating said directory along the way)

2008-11-20 Thread Joshua Lippai
But given the vagueness of what I asked, you're right, os.makedirs was a good suggestion too. Thanks. I think I need to sit down and spend some quality time with the os module over Thanksgiving holiday... Josh On Thu, Nov 20, 2008 at 9:30 AM, Joshua Lippai <[EMAIL PROTECTED]> wrote: > cbook.mkdir

Re: [Matplotlib-users] Saving to a file in a specified directory (and creating said directory along the way)

2008-11-20 Thread Joshua Lippai
cbook.mkdirs includes a few if-then calls that only make the directory if it doesn't already exist (in fact it actually calls os.makedirs in the function), whereas os.makedirs raises an OSError if the folder I specified already exists. For my purposes, the cbook implementation is more convenient.

Re: [Matplotlib-users] Saving to a file in a specified directory (and creating said directory along the way)

2008-11-20 Thread John Hunter
On Thu, Nov 20, 2008 at 11:22 AM, Christopher Barker <[EMAIL PROTECTED]> wrote: > Joshua Lippai wrote: >> Now that just leaves creating the directory. I like >> the cbook.mkdirs implementation a lot better than the non-recursive >> version in os... thanks for the tip! > > why not os.makedirs() ?

Re: [Matplotlib-users] Saving to a file in a specified directory (and creating said directory along the way)

2008-11-20 Thread Christopher Barker
Joshua Lippai wrote: > Now that just leaves creating the directory. I like > the cbook.mkdirs implementation a lot better than the non-recursive > version in os... thanks for the tip! why not os.makedirs() ? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NO

Re: [Matplotlib-users] Saving to a file in a specified directory (and creating said directory along the way)

2008-11-20 Thread Joshua Lippai
Ah, silly me. I forgot to notice I was using a path variable in the string I was giving to mlab.save. Part A works just fine when I account for that. Now that just leaves creating the directory. I like the cbook.mkdirs implementation a lot better than the non-recursive version in os... thanks for t

Re: [Matplotlib-users] Saving to a file in a specified directory (and creating said directory along the way)

2008-11-20 Thread John Hunter
On Thu, Nov 20, 2008 at 10:24 AM, Joshua Lippai <[EMAIL PROTECTED]> wrote: > Hey, > > I'm working on a project for which I would like to dump data into a > file in a specified directory (that doesn't necessarily exist yet). I > know matplotlib.mlab.save(fname, X) will only work if I want to save >

[Matplotlib-users] Saving to a file in a specified directory (and creating said directory along the way)

2008-11-20 Thread Joshua Lippai
Hey, I'm working on a project for which I would like to dump data into a file in a specified directory (that doesn't necessarily exist yet). I know matplotlib.mlab.save(fname, X) will only work if I want to save data from an array/list to a file in the current working directory. Is there an easy w