[Tutor] processing multi entry logs

2006-08-14 Thread Reed L. O'Brien
I have a log file. Essentially the file has 2 important entries for each process id. One when the process starts with an id and a another piece of data. the second is when the process finishes, with the result also with the process id. I need to get data from both to make a sensible representation

Re: [Tutor] Build your own web server in three lines of code

2006-03-23 Thread Reed L. O'Brien
If you have twisted it is in 2 lines like so: $ mktap web -p --path=C:\Python24 $ twistd -f web.tap Ben Vinger wrote: > The nice-looking, revamped Python web site states that > you can do this, but does not go on to say how. > Does anyone know? > > On an OT note, I've recently seen how it

Re: [Tutor] removal

2005-08-04 Thread Reed L. O'Brien
Roger Sell wrote: >Please remove from the Tutor recipient list. > >Thanks, > >Roger Sell > >___ >Tutor maillist - Tutor@python.org >http://mail.python.org/mailman/listinfo/tutor > > Unsubscribe yourself. Don't be lazy. You got on , you can get off.

[Tutor] learning classes (kinda long)

2005-07-30 Thread Reed L. O'Brien
This is a little long a program consisting of bsserver.py ## to define server class and methods bscaller.py ## to define a test class subclasses for services (imap http pop dns et al) bslogger.py ## to log and analyze tests and send emails on exceptions/failures bsmain.py ## that instantiates

Re: [Tutor] confusing smtp problem

2005-07-21 Thread Reed L. O'Brien
nephish wrote: > Sorry about the delay getting back on this one guys, > yeah, i am running a linux machine. > no firewall between here and there (both behind a firewall router) > yeah, sylpheed does send on port 25 > the windows machine has the Merek email server on board. > i would like my scripts

Re: [Tutor] confusing smtp problem

2005-07-20 Thread Reed L. O'Brien
, line 347, in getreply raise SMTPServerDisconnected("Connection unexpectedly closed") SMTPServerDisconnected: Connection unexpectedly closed or is it different?? ~reed > > > On 07/20/2005 03:32:10 PM, Reed L. O'Brien wrote: >> nephish wrote: >> > On 07/2

Re: [Tutor] First Project - Ping Sweeper!

2005-07-12 Thread Reed L. O'Brien
Python wrote: > ping uses icmp. icmp does not have port numbers. icmp is a host-to- > host protocol for managing the flow of packets and reporting errors. > http://en.wikipedia.org/wiki/ICMP_Echo_Request > describes the outgoing "ping packet", but is probably too low-level to > be useful. > > Por

Re: [Tutor] py2exe

2005-07-08 Thread Reed L. O'Brien
D. Hartley wrote: >Hello everyone, and I apologize in advance if anyone gets this message twice. > >I am trying to figure out how to use py2exe. I've created a game and >sent it to friends before, and had to have them install python, >pygame, and livewires in order to play it, which, as you can im

Re: [Tutor] Can't figure out AttributeError message

2005-07-07 Thread Reed L. O'Brien
Jim Roush wrote: >I'm getting the following error message: > > AttributeError: 'tuple' object has no attribute 'seek' > >below is the code that produced the error. The line in question is >marked with arrow in the left margin. Any help would be appreciated. > >def build_sp500_rand(): >

Re: [Tutor] How do I make Python calculate square roots?

2005-07-02 Thread Reed L. O'Brien
Nathan Pinno wrote: > Hi all, > > Does anyone know how to make Python calculate square roots? > > Thanks, > Nathan Pinno > http://www.npinnowebsite.ca/ > > > >_

Re: [Tutor] slicing nested lists/dicts/tuples

2005-06-28 Thread Reed L. O'Brien
Reed L. O'Brien wrote: >Luis N wrote: > > > >>Hi, >> >> >> >>>>>l >>>>> >>>>> >>[{'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar'

Re: [Tutor] slicing nested lists/dicts/tuples

2005-06-28 Thread Reed L. O'Brien
Luis N wrote: > Hi, > > >>> l > [{'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}, > {'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}] > > > This is how I imagine it: > > for i in l: > for j in l[i]: > for k in l[i][j]: > print k.get('first')

[Tutor] Search and Replace

2005-06-24 Thread Reed L. O'Brien
I ma trying to write a script to search adn replace a sizable chink of text in about 460 html pages. It is an old form that usesa search engine no linger availabe. I am wondering if anyone has any advice on the best way to go about that. There are more than one layout place ment for the form, but

Re: [Tutor] strip an email

2005-06-23 Thread Reed L. O'Brien
nephish wrote: > Does anyone know how to strip everything off of an email? > i have a little app that i am working on to read an email message and > write the > body of a message to a log file. > each email this address gets is only about three to five lines long. > but i cannot seem to get just t

[Tutor] Re: manipulating a file

2005-02-08 Thread Reed L. O'Brien
#x27;, 'w') hope that fixes it. About the efficiency, why do u need python at all... How abt a simple shell command cat httpd-access.log>>log.bak Shitiz --- Danny Yoo <[EMAIL PROTECTED]> wrote: On Mon, 7 Feb 2005, Reed L. O'Brien wrote: I want to read th

[Tutor] manipulating a file

2005-02-06 Thread Reed L. O'Brien
I want to read the httpd-access.log and remove any oversized log records I quickly tossed this script together. I manually mv-ed log to log.bak and touched a new logfile. running the following with print i uncommented does print each line to stdout. but it doesn't write to the appropriate file