Re: Need script to download file at known address
From: phansen (peter_at_engcorp.com)
Date: 09/17/04
- Next message: Andrew Degtiariov: "[implement python code in C] can't set attributes of built-in/extension type"
- Previous message: Alex Martelli: "Re: Small inconsistency between string.split and "".split"
- In reply to: Jeff Shannon: "Re: Need script to download file at known address"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 17 Sep 2004 08:05:15 -0400
Jeff Shannon wrote:
> Radioactive Man wrote:
>> Are there any variants of the "open" commmand that
>> allow location (drive and directory) of the file to be specified as
>> well, for example, if I wanted to save the file as
>> "D:\binaries\trash.gif" instead of the default location?
>
> As a matter of fact, the standard open() will handle that just fine --
> it accepts a pathname, rather than just a filename, so you can feed it
> an absolute path like your example or a relative path ...
But note that the directories have to exist already. If they don't,
you need to use something like os.makedirs() to get 'em.
-Peter
- Next message: Andrew Degtiariov: "[implement python code in C] can't set attributes of built-in/extension type"
- Previous message: Alex Martelli: "Re: Small inconsistency between string.split and "".split"
- In reply to: Jeff Shannon: "Re: Need script to download file at known address"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|