Hello Edward!
On Thursday 15 March 2007 03:53, Edward A Robinson wrote:
> I guess what Im looking for is a python command that dose what the
> file command in the shell would do
I don't think there is anything like this in Python's standard
library. Probably Gnome has a library for identifying t
Edward A Robinson wrote:
> I guess what Im looking for is a python command that dose what the
> file command in the shell would do
>
> On 3/14/07, Edward A Robinson <[EMAIL PROTECTED]> wrote:
>> This is my first time posting to the python tutor so be nice, I have
>> read the mailing list and cant
I guess what Im looking for is a python command that dose what the
file command in the shell would do
On 3/14/07, Edward A Robinson <[EMAIL PROTECTED]> wrote:
> This is my first time posting to the python tutor so be nice, I have
> read the mailing list and cant seem to find and answer there or on
> Alan, you missed the last part of the code - he writes the rest of
> the data following the match into the file.
I didn't miss it but I did misread it! :-)
>file.write(contents[pos + len(name):])
I assumed 'name' was here referring to the actual value inserted.
But of course that would hav
Alan G wrote:
> ARe you sure? The problem using seek and write is that if the data
> you are inserting is bigger than your marker you will overwrite the
> data following the marker.
Alan, you missed the last part of the code - he writes the rest of the data
following the match into the file.
Thi
>
> basically I took the idea and the code example given and wrote this
> little function, i stuck vars in this html page like #email# and
> just used it like this, " insertdata('#email#','[EMAIL PROTECTED]')
>
> works perfect!
ARe you sure? The problem using seek and write is that if the data
y
Bob Gailer wrote:
> At 02:55 PM 8/24/2005, Scott Oertel wrote:
>
>> How do I use the built in file objects to insert text into a file at a
>> certain location?
>>
>> i.e.
>>
>> something, 2, chance, weee
>> nothing, happened, crap, nice
>>
>> need to search for "something" and insert, "what,"
Byron wrote:
Bob Gailer wrote:
read the file into a string variable (assuming the file is not humungus)
find the location of "something" in the string
assemble a new string consisting of:
the original string up to the location (index) of "something"
"what"
the rest of the
Bob Gailer wrote:
> read the file into a string variable (assuming the file is not humungus)
> find the location of "something" in the string
> assemble a new string consisting of:
>the original string up to the location (index) of "something"
>"what"
>the rest of the original string
>
At 02:55 PM 8/24/2005, Scott Oertel wrote:
>How do I use the built in file objects to insert text into a file at a
>certain location?
>
>i.e.
>
>something, 2, chance, weee
>nothing, happened, crap, nice
>
> need to search for "something" and insert, "what," before it
Here's the algorithm. If y
10 matches
Mail list logo