Re: except clause appears to be being skipped?

2007-03-23 Thread AWasilenko
On Mar 23, 10:29 pm, "John Machin" <[EMAIL PROTECTED]> wrote: > It *is* "pulling up the 404 function", which *is* returning your error > page. However all your except clause does is "self.err404(dex)" -- you > ignore the return value, and fall out of the except clause with > textfile undefined, wit

except clause appears to be being skipped?

2007-03-23 Thread AWasilenko
hat's where the problems come in, I want it just to call the err404 function and return my 404 page, but it seems to act like its not there and keeps on going, giving me this error: Traceback (most recent call last): File "/home2/awasilenko/lib/python2.4/cherrypy/_cprequest.py", line 342,

Re: Printing from a text file quirk

2007-03-22 Thread AWasilenko
> Where can I see that? From the python language documentation here: > > http://docs.python.org/lib/lib.html > > you can look up readline() and see: > -- > readline( [size]) > Read one entire line from the file. A trailing newline character is > kept in the string > - > > The

Re: Printing from a text file quirk

2007-03-22 Thread AWasilenko
Humm I think I messed up the code before I pasted it, I am now able to get the left tag on the same line with this: headerp1 = "" for i in range(5): headerp1 += self.headertxt.readline() headerp2 = self.headertxt.readline(7) headerp3 = self.headertxt.readline() headerp4 = self.headertxt.re

Printing from a text file quirk

2007-03-22 Thread AWasilenko
I have a html document saved as a text file that I'm trying to load. Its just the header section so my object is to read all the lines till I hit the tag, break, then read the rest. I have kinda achieved what I wanted, but I'm getting a new line where I stopped. It will become clear once you see

Re: TypeError: 'int' object is not callable

2007-03-22 Thread AWasilenko
/> > > > Sorry the page: """ + str(whatitis) + """ does not exist. > > > > """ > > > and here is the error I get when trying to run this: > > > 500 Internal Server Error > > The server encountered an unexpected

TypeError: 'int' object is not callable

2007-03-22 Thread AWasilenko
" and here is the error I get when trying to run this: 500 Internal Server Error The server encountered an unexpected condition which prevented it from fulfilling the request. Traceback (most recent call last): File "/home2/awasilenko/lib/python2.4/cherrypy/_cprequest.py&

Re: struct.pack returns nothing

2007-03-18 Thread AWasilenko
On Mar 19, 1:12 am, [EMAIL PROTECTED] wrote: > If I build a strict with: > > import struct > print struck.pack ('i', 1) > > it returns a '\n'. > What's wrong with it??? > :( > > -- > Andrés M. > - Looks like you spelled struct wrong in the code :) -- h

Re: Trying to print from inside a method

2007-03-18 Thread AWasilenko
On Mar 18, 7:32 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > Here, the message1 and message2 names are LOCAL variables of the > respective methods: each disappear as soon as its method ends. > > If you want to make them into INSTANCE attributes, so they'll stick > around for later, assign to self

Trying to print from inside a method

2007-03-18 Thread AWasilenko
I'm still in the process of learning python via a handful of books I bought. One book I am reading just introduced Base Class Methods. I found that I needed more understanding on this concept and wrote a short test program using the Author's code as a vague reference. My question now really isn'