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
Thanks for the help guys.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
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
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
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
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
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
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
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
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:
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
11 matches
Mail list logo