* Chris Mellon [EMAIL PROTECTED] [2005-12-15 06:09]:
(Am I dating myself? Do teenagers still put studs on their jackets?)
No. They put studs in their lips, tongues, eyebrows, navels, and sexual
organs.
Oh, and ears. (How quaint.)
--
http://mail.python.org/mailman/listinfo/python-list
I want to match one or two instances of a pattern in a string.
According to the docs for the 're' module
( http://python.org/doc/current/lib/re-syntax.html ) the '?' qualifier
is greedy by default, and adding a '?' after a qualifier makes it
non-greedy.
The *, +, and ? qualifiers are all
[John Hazen]
I want to match one or two instances of a pattern in a string.
s = 'foobarbazfoobar'
foofoo = re.compile(r'^(foo)(.*?)(foo)?(.*?)$')
foofoo.match(s).group(1)
'foo'
foofoo.match(s).group(3)
[Tim Peters]
Your problem isn't that
(foo)?
is not greedy
[Mike Meyer]
The thing to understand is that regular expressions are *search*
functions, that return the first parsing that matches. They search a
space of possible matches to each term in the expression. If some term
fails to match, the preceeding term goes on to its next match, and you
try
Hi Jesse-
def hostforward():
#This is based on the assumption that the passfile is the gnus
#authinfo file, or has a similar format...
f = open(PASS_FILE, r)
f_list = f.read().split(' ')
f.close()
#Now, we get the entry after password (be slicker to make it a
* George [EMAIL PROTECTED] [2005-09-25 16:20]:
Hello everyone I know many have helped but I cannot get this to work
out correctly.
snip
Please help I have never done python before and I can't seem to get the
hang of it.
You posted code. Is what's in the docstring actual output? If so, what
* Jason [EMAIL PROTECTED] [2005-09-19 16:28]:
I've restructured my code with the assistance of George and Mike which
is now as follows...
import random
class HiScores:
def __init__(self,hiScores):
self.hiScores=[(entry[:5],entry[5:]) for entry in hiScores]
With your
* n00m [EMAIL PROTECTED] [2005-08-31 05:45]:
import socket, thread
host, port = '192.168.0.3', 1434
s1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s2.connect((host, 1433))
s1.bind((host, port))
I think the problem is that you're
This is probably a fairly bad way of contacting the python-list
admins...
Perhaps. Feel free to forward if you know a better way.
I tried sending a question to [EMAIL PROTECTED], and got
another 'don't call us, we'll maybe call you'. Maybe
[EMAIL PROTECTED]
But public posting allows
[[]]*2
[[], []]
[[], []] == [[]]*2
True
Same effect. But try the 'is' operator, to see if they are actually the
same instances of 'empty list':
[[], []] is [[]]*2
True
Just curious, did you actually cut and paste this from a real
interactive session? (I think not.) My
* Brian Lee [EMAIL PROTECTED] [2005-07-26 06:34]:
Subscribe
OK. You're now subscribed to thousands of spam lists. Congratulations!
;)
You can subscribe to the python-list here:
http://mail.python.org/mailman/listinfo/python-list
Good luck-
John
--
* Helge Aksdal [EMAIL PROTECTED] [2005-07-19 11:23]:
if i then change to a console window, and telnet to this server it
sends me to another one. That's probably why my program dies, how
can i get my code to handle this?
Trying xxx.xxx.xxx.xxx
telnet: connect to address xxx.xxx.xxx.xxx:
* Brian Quinlan [EMAIL PROTECTED] [2005-07-15 02:08]:
You can find the first problem here:
http://www.sweetapp.com/pycontest/contest1
I have one question about the problem. Is the cost we are to minimize
the cost of arriving in the target city at all, or the cost of arriving
at the target
[Erik Max Francis]
Searching for straights and flushes is much better done by masks.
Interesting. I've been thinking about playing with this stuff too, but
hadn't considered masks. So each card has a representation:
n bits for rank, then m bits for suit.
10 0001 = 2 clubs
* [EMAIL PROTECTED] [EMAIL PROTECTED] [2005-05-02 05:10]:
Any hints on level 6 ?
There is zip in the page source, ZIp in the
image data, but have no clue what to do with them
- tried many things :).
Have you found the zip file yet?
(I did, and I still can't figure it out. I'm wondering if
* Reinhold Birkenfeld [EMAIL PROTECTED] [2005-05-02 06:19]:
John Hazen wrote:
Have you found the zip file yet?
(I did, and I still can't figure it out)
It's best when you use the zipfile module.
Cool. I had just unzipped the zipfile, and was looking at the files
directly
* Dan Bishop [EMAIL PROTECTED] [2005-05-02 21:09]:
Dan Christensen wrote:
Reinhold Birkenfeld [EMAIL PROTECTED] writes:
Dan Christensen wrote:
Roel Schroeven [EMAIL PROTECTED] writes:
There's no level 12 yet though.
Now there's a 12 and a 13 (at least!).
Anyone solved
* Dave Brueck [EMAIL PROTECTED] [2005-04-14 07:49]:
[Roel Schroeven]
Not that it really matters, but does anybody know why the weekly Python
news always arrives twice? Does it only happen to me, or does it happen
to others too?
It's not that it irritates me or anything, I'm just being
18 matches
Mail list logo