Calvin Spealman wrote:
> On 7/31/05, James Dennett <[EMAIL PROTECTED]> wrote:
>
>>Peter Hansen wrote:
>>
>>
>>>Steven D'Aprano wrote:
>>>
>>>Given that ZODB and PySQLite are simply Python extension modules, which
>>>get bundled by your builder tool and are therefore installed
>>>transparently alon
Calvin Spealman wrote:
> On 7/31/05, James Dennett <[EMAIL PROTECTED]> wrote:
>
>>Peter Hansen wrote:
>>
>>
>>>Steven D'Aprano wrote:
>>>
>>>Given that ZODB and PySQLite are simply Python extension modules, which
>>>get bundled by your builder tool and are therefore installed
>>>transparently alon
On 7/31/05, James Dennett <[EMAIL PROTECTED]> wrote:
> Peter Hansen wrote:
>
> > Steven D'Aprano wrote:
> >
> > Given that ZODB and PySQLite are simply Python extension modules, which
> > get bundled by your builder tool and are therefore installed
> > transparently along with your app by your ins
Peter Hansen wrote:
> Steven D'Aprano wrote:
>
>> On Wed, 27 Jul 2005 04:26:31 +, Andrew Dalke wrote:
>>
>>> This isn't 1970. Why does your app code work directly with
>>> files? Use a in-process database library (ZODB, SQLLite,
>>> BerkeleyDB, etc.) to maintain your system state and let th
Steven D'Aprano wrote:
> On Wed, 27 Jul 2005 04:26:31 +, Andrew Dalke wrote:
>>This isn't 1970. Why does your app code work directly with
>>files? Use a in-process database library (ZODB, SQLLite,
>>BerkeleyDB, etc.) to maintain your system state and let the
>>library handle transactions for
On Wed, 27 Jul 2005 04:26:31 +, Andrew Dalke wrote:
> This isn't 1970. Why does your app code work directly with
> files? Use a in-process database library (ZODB, SQLLite,
> BerkeleyDB, etc.) to maintain your system state and let the
> library handle transactions for you.
And when users are
> [EMAIL PROTECTED] wrote:
>> Well, it's what (R)DBMS are for, but plain files are not.
Steven D'Aprano wrote:
> This isn't 1970, users expect more from professional
> programs than "keep your fingers crossed that nothing
> bad will happen". That's why applications have multiple
> levels of und
[EMAIL PROTECTED] wrote:
> Tue, Jul 26, 2005 at 01:41:36PM +1000, Steven D'Aprano пишет:
>
>>Long ago, when dinosaurs roamed the Earth, (a.k.a.
>>"before OS X on the Macintosh") Apple suggested a bit
>>of Pascal code for safely updating a file:
>>
>>http://developer.apple.com/documentation/mac/F
Tue, Jul 26, 2005 at 01:41:36PM +1000, Steven D'Aprano пишет:
> Long ago, when dinosaurs roamed the Earth, (a.k.a.
> "before OS X on the Macintosh") Apple suggested a bit
> of Pascal code for safely updating a file:
>
> http://developer.apple.com/documentation/mac/Files/Files-25.html#MARKER-9-16
Wade wrote:
> Steven D'Aprano wrote:
>
>>I'm usually opposed to creeping featuritis in programming languages ("it
>>would be really cool if Python had a built-in command to do my entire
>>application") but safe over-writing of files does cry out for a "batteries
>>included" approach:
>
>
>
> H
Steven D'Aprano wrote:
>I'm usually opposed to creeping featuritis in programming languages ("it
>would be really cool if Python had a built-in command to do my entire
>application") but safe over-writing of files does cry out for a "batteries
>included" approach:
How about the fileinput module?
On Mon, 25 Jul 2005 20:51:42 +0100, Steve Holden wrote:
> In Python you can use a text file's readlines() method to build a list
> of all the lines in a file. That makes it quite easy to change numbered
> lines. Having modified the file's content in memory you can then create
> a new file using
On 25 Jul 2005 12:57:55 -0700,
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> A recipe is
> * open your file for reading: f = open('filename.txt', 'r')
> * read all lines in a list: content = f.readlines()
> * close the file: f.close()
> * set the third element in the list to something else: con
Gee whiz, so easy.
thanks. Never thought about just changing it while it was read then
re-writing it. that will be just fine. these files are only 9 lines
long.
thanks again !
--
http://mail.python.org/mailman/listinfo/python-list
A recipe is
* open your file for reading: f = open('filename.txt', 'r')
* read all lines in a list: content = f.readlines()
* close the file: f.close()
* set the third element in the list to something else: content[2] =
'Blahdiblah'
* re-open the file for writing: f = open('filename.txt', 'w')
* wr
[EMAIL PROTECTED] wrote:
> Hey there,
> kinda newbie question here.
> i know how to read the lines of a txt file.
> i know how to write a txt file.
>
> but how do i overwrite a line value with another value ?
>
> i mean, how do go to, say, line 3 of a text file and replace
> what is written on li
Hey there,
kinda newbie question here.
i know how to read the lines of a txt file.
i know how to write a txt file.
but how do i overwrite a line value with another value ?
i mean, how do go to, say, line 3 of a text file and replace
what is written on line 3 with something else?
thanks
<><
--
17 matches
Mail list logo