[Tutor] while loops

2005-08-08 Thread Will Harris
I am working my way through "python programming for the absolute beginner" and one of the challenges is to create a program that will flip a coin 100 times and tell you how many of each it did. Now I have it flipping the coin, but when I try to do this 100 times I end up with it running through

Re: [Tutor] while loops

2005-08-08 Thread Will Harris
Thanks for the help guys. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Print Output Location in Windows XP

2005-09-02 Thread Will Harris
Something I do is like raw_input("\n\nPress enter to exit.") at the end, this works if all you want to do is see the text on the screen. Tom Strickland wrote: >Up until now I have been running my Python programs in Linux. I just >wrote one in Windows XP and I can't find the print output. The P

[Tutor] slices

2005-11-17 Thread Will Harris
Is there an easy way to slice the last set of characters off a string when I don't know the length of the string? For example say I have a list of words like    this    though    weather I want to get the last 2 characters from each. But so far nothing I have tried has seeme

Re: [Tutor] slices

2005-11-17 Thread Will Harris
Blah brain freeze I saw my mistake as I hit send. It should just be word[-2:] So #!/usr/bin/python import sys for word in sys.argv[1:]: print word[-2:] Works now. Thanks! On 11/17/05, Will Harris <[EMAIL PROTECTED]> wrote: Is there an easy way to slice the last set of characte

[Tutor] log parsing

2005-11-29 Thread Will Harris
I am trying to work out doing a bit of log parsing in python. Below is the code I have gotten so far, It works in an earlier version of this one but this one doesn't print out the lines in my log files. Does anyone see anything that I am missing here or can just point me in the direction to look? T

Re: [Tutor] log parsing

2005-11-30 Thread Will Harris
Cool, thanks Kent.On 11/29/05, Kent Johnson <[EMAIL PROTECTED]> wrote: Will Harris wrote:> I am trying to work out doing a bit of log parsing in python. Below is> the code I have gotten so far, It works in an earlier version of this> one but this one doesn't print out the l

[Tutor] Editors

2005-12-12 Thread Will Harris
Any of you familar with SPE ? I found this just recently on freshmeat and was curious if anyone had used it? If so how well it works and what not. This caught my attention because its cross platform (written in python). ___ Tutor maillist - Tutor@python

[Tutor] regex

2005-12-26 Thread Will Harris
Does anyone see anything that jumps out at them on why these regex strings aren't catching this line: Dec 18 10:04:45 dragon logger: TCPWRAP: SERVICE=sshd@:::192.168.0.1,TYPE=ALL_DENY,HOST_ADDRESS=:::195.145.94.75,HOST_INFO=:::195.145.94.75,HOST_NAME=unknown,USER_NAME=unknown,OTHERINFO

Re: [Tutor] regex

2005-12-28 Thread Will Harris
Thanks, this helped out. I hadn't thought of trying to use strings for this, I will give that a shot. I removed the TYPE field from the regex thinking that might have been causing a problem and forgot to add it back to my regex.On 12/27/05, Kent Johnson <[EMAIL PROTECTED]> wrote:Danny Yoo wrote:

[Tutor] code review request

2006-01-04 Thread Will Harris
Hoping to get some of you guru types to look over the start of a tool I am working on in python. A working version of the script is at https://mikaru.homeunix.org/py-bin/memberlist.py The site only allows https because I got sick of all the hacked windoze boxes trying to execute crap that I didn