I don't know then. Just hack your way through and tell us how did you manage
to do it. ;)
On Sun, May 25, 2008 at 9:32 PM, Kent Johnson <[EMAIL PROTECTED]> wrote:
> Forwarding to the list with my reply...
>
> On Sun, May 25, 2008 at 2:20 PM, Chester <[EMAIL PROTECTED]> wrote:
> > Python uses \n
Forwarding to the list with my reply...
On Sun, May 25, 2008 at 2:20 PM, Chester <[EMAIL PROTECTED]> wrote:
> Python uses \n as the newline character (which is a UNIX/Linux newline
> character). I see you have Python for Windows installed and running it on
> the Windows OS. The file objectconfig
On Sat, May 24, 2008 at 7:09 PM, Jason Conner <[EMAIL PROTECTED]> wrote:
> def loadItem(self, objectToLoad):
> wordList = []
> fobj = open('/home/jason.conner/Documents/Python/objectconfig.txt', 'r')
>
> for line in fobj:
> if line == objectToLoad:
> wordList.append
Hey guys,
I went with a combination of the above, though I tried several different
solutions. Here's what I ended up with:
def loadItem(self, objectToLoad):
wordList = []
fobj = open('/home/jason.conner/Documents/Python/objectconfig.txt', 'r')
for line in fobj:
if line == obj
"Marilyn Davis" <[EMAIL PROTECTED]> wrote
(I'm sorry for the duplicate, Alan.)
I didn't see a duplicate! ;-)
linecount = 0
for line in file("itemconfig.txt", 'rU'):
if line == objectToLoad or linecount > 0:
if linecount == 0: linecount = 5
itemList.append(line.split()[:5
(I'm sorry for the duplicate, Alan.)
On Fri, May 23, 2008 3:49 am, Alan Gauld wrote:
> "Jason Conner" <[EMAIL PROTECTED]> wrote
>
>
>> building a program that will take a text file, search for a string in
>> that text file. Once it finds the string its looking for, I want to put
>> the next five
"Jason Conner" <[EMAIL PROTECTED]> wrote
building a program that will take a text file, search for a string
in that
text file. Once it finds the string its looking for, I want to put
the next
five lines of text into a variable. Here's what I have so far:
def loadItem(self, objectToLoad):
On 23/05/2008, Jason Conner <[EMAIL PROTECTED]> wrote:
Hi Jason,
> def loadItem(self, objectToLoad):
> x = 0
> wordList = []
> fobj = file()
> fobj.open("itemconfig.txt", 'rU')
>
> for line in fobj.readline():
In recent pythons, you can write this better as:
for line in fob
Hey guys,
Very new to programming Python, and I'm running up against a problem. I am
building a program that will take a text file, search for a string in that
text file. Once it finds the string its looking for, I want to put the next
five lines of text into a variable. Here's what I have so far: