[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: python обнуление файла



Artem Chuprina пишет:
Andrey N. Prokofiev -> Debian-russian  @ Tue, 29 Sep 2009 19:43:48 +0400:

 ANP> Собственно необходимо на python обнулить файл. Подскажите как это
 ANP> можно более правильно сделать

Я думаю, как и на всех остальных языках.  Открыть его на запись.

Я сделал так:
log = open(log_file, "w")
log.write('')
log.close()

но не думаю что это кошерный вариант.

--
Best Regards, Andrey.
Jabber ID: andy@eth0.spb.ru
E-mail: andy@eth0.spb.ru / andy@unix-way.spb.ru
:wq

begin:vcard
fn:Andrey N. Prokofiev
n:Prokofiev;Andrey
email;internet:andy@eth0.spb.ru
tel;cell:+7-951-6886260
note:My Jabber ID: andy@eth0.spb.ru
x-mozilla-html:FALSE
version:2.1
end:vcard


Reply to: