[Tutor] Web-log, not blog

2006-01-09 Thread Øyvind Dale Spørck



Hello and thank you
for your help. 

Scratchy seems like
a really good product...

Have a nice
day,
Øyvind

Øyvind wrote:
 Hello.

 I am trying to find some Pythonmodules to work with some webserver logs. I
 have found http://www.mnot.net/python/WebLog/, but it is very old (from
 1999).   And when I try to serach in Google and so forth, all I get is
 Python weblogs as in blogs. Do you have some suggestions of other sites
 about analyzing webtraffic with Python?

Googling "+python webserver log analyze" and checking PyPI yielded a few
more choices:
http://mithrandr.moria.org/code/sisynala/
http://www.phil-schwartz.com/scratchy.spy

Kent

-
The information contained in this message may be CONFIDENTIAL 
and is intended for the addressee only. Any unauthorised use, 
dissemination of the information or copying of this message is prohibited. 
If you are not the addressee, please notify the sender immediately by return 
e-mail and delete this message.
Thank you.
Intility
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-09 Thread John Joseph
 Hi  Brian 
It was a  excellent  tutorial, Thanks a
lot for the advice  I got my concepts of  def of
functions , sort functions , count , cleared for me 
   I was able to do and understand all the
 function example , except “item_comparison” function 
   I get the error  for set 
  set((1,1,1,2,2,2,2,2,3,4,4,5))
Traceback (most recent call last):
  File stdin, line 1, in ?
NameError: name 'set' is not defined

my python versrion is 
Python 2.3.4 (#1, Nov  4 2004, 14:06:56)
[GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2
THANKS 
  Joseph John 

--- Brian van den Broek [EMAIL PROTECTED] wrote:

 John Joseph said unto the world upon 08/01/06 06:36

We no longer need the continue clause, as converting
to set ensures we 
won't ever deal with the same item twice:

  set((1,1,1,2,2,2,2,2,3,4,4,5))
set([1, 2, 3, 4, 5])


And, preventing us from dealing with the same item
twice is what makes 
this better. To see that, consider:

  def iteration_comparison(sequence):
list_count = 0
set_count = 0
for i in list(sequence):
list_count += 1
for i in set(sequence):
set_count += 1
print list_count, set_count

=== message truncated ===






___ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python on Windows: any way to access shortcut's info?

2006-01-09 Thread Terry Carroll
On Sun, 8 Jan 2006, Kent Johnson wrote:

 You can set the command line arguments and working directory for a 
 shortcut by opening the properties window on the shortcut, at least in 
 Win2k.

Thanks, Kent. 

My question is whether there's any way to get the name and directory of
the shortcut from the program.


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-09 Thread Brian van den Broek
John Joseph said unto the world upon 09/01/06 03:47 AM:
  Hi  Brian 
 It was a  excellent  tutorial, Thanks a
 lot for the advice  I got my concepts of  def of
 functions , sort functions , count , cleared for me 
I was able to do and understand all the
  function example , except “item_comparison” function 
I get the error  for set 
   set((1,1,1,2,2,2,2,2,3,4,4,5))
 Traceback (most recent call last):
   File stdin, line 1, in ?
 NameError: name 'set' is not defined
 
 my python versrion is 
 Python 2.3.4 (#1, Nov  4 2004, 14:06:56)
 [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2
 THANKS 
   Joseph John 


Joseph,

glad you found the ramble of use :-)

Your python is a version before set was a built-in type (2.4, I 
believe). So, the iteration_comparison *and* dupe_detector_5 functions 
won't work for you.

2.3 did include the sets module, though.

So, stick

from sets import set

at the top of the code and it ought work.

Best,

Brian vdB
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-09 Thread Kent Johnson
Brian van den Broek wrote:
 Your python is a version before set was a built-in type (2.4, I 
 believe). So, the iteration_comparison *and* dupe_detector_5 functions 
 won't work for you.
 
 2.3 did include the sets module, though.
 
 So, stick
 
 from sets import set
 
 at the top of the code and it ought work.

The class name is different in 2.3 also. Use
from sets import Set as set

to get the same spelling as in 2.4.

Kent

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-09 Thread Danny Yoo

 lot for the advice I got my concepts of def of functions , sort
 functions , count , cleared for me
I was able to do and understand all the
  function example , except �item_comparison� function
I get the error  for set
   set((1,1,1,2,2,2,2,2,3,4,4,5))
 Traceback (most recent call last):
   File stdin, line 1, in ?
 NameError: name 'set' is not defined

Hi John,

For Python 2.3.4, you'll need to add the line:

##
from sets import Set as set
##

before trying to use 'set'.  Sets weren't so built into Python until
Python 2.4, and so examples that use 'set()' will need that above line to
install the proper support.

Best of wishes!

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Landscape Printing

2006-01-09 Thread bob
At 05:48 AM 1/8/2006, John Corry wrote:
Hi,

My text file is printing out in portrait.  Is there any instruction that I
can use so that notepad prints it in landscape?

I doubt that you can do this with notepad. Certainly not with 
ShelleExecute. You could do some fancy footwork with opening notepad, 
getting its window's handle, and sending keystrokes to navigate the 
pase setup and print dialogs. Or you'd need an application that can 
have its print setup globally configured, or one that supports 
command line options for printing, or one that you communicate with 
using COM (such as MS Word). 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor