On Mon, Mar 09, 2015 at 08:51:52PM -0500, Zachary Ware wrote:
> On Mar 9, 2015 7:25 PM, "Steven D'Aprano" wrote:
> > What I really want is an option to open() that only
> > opens a new file, and fails if the file already exists.
>
> If I'm not mistaken, this is the 'x' open mode, added in Python
On Mar 9, 2015 7:25 PM, "Steven D'Aprano" wrote:
> What I really want is an option to open() that only
> opens a new file, and fails if the file already exists.
If I'm not mistaken, this is the 'x' open mode, added in Python 3.4 (or
maybe 3.3, I forget).
--
Zach
_
On 10 March 2015 at 00:22, Steven D'Aprano wrote:
> On Mon, Mar 09, 2015 at 04:50:11PM +, Alan Gauld wrote:
>>
>> Somebody posted a question asking how to fond out if a file
>> exists. The message was in the queue and I thought I'd approved
>> it but it hasn't shown up yet. Sorry to the OP if
On Mon, Mar 09, 2015 at 04:50:11PM +, Alan Gauld wrote:
> Somebody posted a question asking how to fond out if a file
> exists. The message was in the queue and I thought I'd approved
> it but it hasn't shown up yet. Sorry to the OP if I've messed up.
>
> The answer is that you use the os.path
On 09.03.2015 18:50, David Heiser wrote:
On 3/9/2015 9:50 AM, Alan Gauld wrote:
Somebody posted a question asking how to fond out if a file
exists. The message was in the queue and I thought I'd approved
it but it hasn't shown up yet. Sorry to the OP if I've messed up.
The answer is that you
On 3/9/2015 9:50 AM, Alan Gauld wrote:
Somebody posted a question asking how to fond out if a file
exists. The message was in the queue and I thought I'd approved
it but it hasn't shown up yet. Sorry to the OP if I've messed up.
The answer is that you use the os.path.exists() function.
It take
Somebody posted a question asking how to fond out if a file
exists. The message was in the queue and I thought I'd approved
it but it hasn't shown up yet. Sorry to the OP if I've messed up.
The answer is that you use the os.path.exists() function.
It takes a path as an argument which can be relat