I'm battling to understand this. I am switching to python while in a
production environment so I am tossed into the deep end. Python seems
easier to learn than other languages, but some of the conventions still
trip me up. Thanks for the link - I'll have to go through all the
previous chapters to
Alex Martelli wrote:
Rene Pijlman [EMAIL PROTECTED] wrote:
Peter Otten:
s = set([one-and-only])
item, = s
...
The comma may easily be missed, though.
You could write:
(item,) = s
But I'm not sure if this introduces additional overhead.
Naah...:
helen:~ alex$ python
[EMAIL PROTECTED] wrote:
and put them on the widgets like this:
Label(win, text=message, background=rgb(150,150,120), image=photo2).pack()
...
Now, I want the same program to run as exe file on another computer,
so I compiled it with py2exe. I copied the bmp's to the same folder as
my
I have some places in pyparsing where I've found that the most
straightforward way to adjust an instance's behavior is to change its class.
I do this by assigning to self.__class__, and things all work fine.
(Converting to use of __new__ is not an option - in one case, the change is
temporary,
Paul McGuire wrote:
I have some places in pyparsing where I've found that the most
straightforward way to adjust an instance's behavior is to change its class.
Hooray ! You've just (re)discovered the state pattern... for which the
most stupid simple implementation in Python is to :
(snip)
Fred wrote:
I hope someone can help me with the below problem...
Thanks,
Fred
My enviroment:
--
Slackware Linux 10.2
Python 2.4.2
MySql version 4.1.14
MySql-Python 1.2.0
What I am trying to do:
---
Using MySQL, Python, My-Sql-Python
bruno at modulix wrote:
Paul McGuire wrote:
or am I taking advantage of a fortuitous accident, which may get
undone at a future time?
It's certainly not a fortuitous accident.
And even the (printed) cookbook has examples which assign to
self.__class__... I guess this means this feature
Dear all,
another little question, I use idle 1.1.2, is there a way to use a
history for the command line?
thanks in advance
--
http://mail.python.org/mailman/listinfo/python-list
Take a look at www.reportlab.org. The ReportLab library includes a
graphics module that might well do what you need. I'm not sure at
present if it allows one to set alpha-channels to achieve transparency.
Also, if you have access to a mac running OS X 10.4, the Automator
application has a
Hi all,
I want to take an existing pdf and add it a non-opaque watermark.
I have tried it in postscript but postscript hava an opaque imaging model.
Pdf allows it. I can do it with acrobat 6.0, but i need to add the watermark in
batch mode or inside an application.
I've found lowagie library
Runsun Pan helped me out with the following:
You can also try the following very primitive solution that I
sometimes
use to extract simple information in a quick and dirty way:
def extract(text,s1,s2):
''' Extract strings wrapped between s1 and s2.
t=this is a
Rob Cowie wrote:
Take a look at www.reportlab.org. The ReportLab library includes a
graphics module that might well do what you need. I'm not sure at
present if it allows one to set alpha-channels to achieve transparency.
ReportLab allows one to set a transparent image colour mask which is
R. Bernstein wrote:
Giovanni Bajo suggests:
If you call OptionParser.disable_interspersed_args() on your parser,
it will stop parsing at the first positional argument, leaving other
options unparsed.
Wow - that was a quick answer! Thanks - it works great!
I see how I missed this.
Fred wrote:
I hope someone can help me with the below problem...
Thanks,
Fred
My enviroment:
--
Slackware Linux 10.2
Python 2.4.2
MySql version 4.1.14
MySql-Python 1.2.0
What I am trying to do:
---
Using MySQL, Python, My-Sql-Python
Hello there.
I'm creating a little text changer in Python. In the program there is a
while loop. The problem is that a while loop will have 1 print statement
and it will loop until it gets to the end of the text.
Example:
num = 5 // Set num to 5
while num = 1: // loop 5 times.
print
On Wed, 25 Jan 2006 15:50:27 -0600, [EMAIL PROTECTED] wrote:
If they need to resume their calculations from where they left off
after the last yield.
Wolfgang Well, no, independently from that.
Wolfgang Just to avoid to inital overhead of the function call.
How do you pass
Danny wrote:
Hello there.
I'm creating a little text changer in Python. In the program there is a
while loop. The problem is that a while loop will have 1 print statement
and it will loop until it gets to the end of the text.
Example:
num = 5 // Set num to 5
while num = 1: // loop 5
Enrique Palomo Jiménez wrote:
Hi all,
I want to take an existing pdf and add it a non-opaque watermark.
I have tried it in postscript but postscript hava an opaque imaging model.
Pdf allows it. I can do it with acrobat 6.0, but i need to add the watermark
in batch mode or inside an
Danny wrote:
snip
As a shortcut:
print text*5
--- Heiko.
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
Of course. I was just trying to make a point about string accumulation being
O(n) and not O(n^2).
But according to Fredrik, string accumulation is still quadratic, even
with the optimizations added to Python 2.4. Quoting:
it only means that if the interpreter can
Danny wrote:
How could I make this print: texttexttexttexttext?
Ive researched and looked through google and so far I can't find
anything that will help (or revelent for that matter).
I am not quite sure, if I simplify the problem but i thought about
something like that:
print
I think I should paste some of the programs code a little more of what I
want...
var = 0
while var = 5:
print a[t[var]]
var = var +1
a is a dectionary (very big) and t is a string of text. (if that's
important right now).
I'm just trying to make the value of a[t[var]] print on one
Danny wrote:
I think I should paste some of the programs code a little more of what I
want...
var = 0
while var = 5:
print a[t[var]]
var = var +1
a is a dectionary (very big) and t is a string of text. (if that's
important right now).
I'm just trying to make the value of
Great! It's been solved.
The line, as Glaudio said has a , at the end and that makes it go onto
one line, thanks so much man!
var = 0
while = 5:
print a[t[var]],
var = var +1
prints perfectly, thanks so much guys.
--
http://mail.python.org/mailman/listinfo/python-list
Danny wrote:
I think I should paste some of the programs code a little more of what I
want...
var = 0
while var = 5:
print a[t[var]]
var = var +1
a is a dectionary (very big) and t is a string of text. (if that's
important right now).
I'm just trying to make the value of
Danny wrote:
Great! It's been solved.
The line, as Glaudio said has a , at the end and that makes it go onto
one line, thanks so much man!
var = 0
while = 5:
print a[t[var]],
var = var +1
prints perfectly, thanks so much guys.
if you wanted spaces between the items, why didn't
Terry Hancock:
Rene Pijlman:
Option 1:
Install ZODB in the Python installation in the usual way.
Should I expect problems when I install and run zope with
that Python installation?
I think this should work, actually.
ZODB is just like other databases in that each application
is going to
Danny [EMAIL PROTECTED] wrote:
The programs output will be:
text
text
(etc)
How could I make this print: texttexttexttexttext?
Ive researched and looked through google and so far I can't find
anything that will help (or revelent for that matter).
I'm kind of surprised this isn't a FAQ (if it's
Danny wrote:
Great! It's been solved.
The line, as Glaudio said has a , at the end and that makes it go onto
one line, thanks so much man!
var = 0
while = 5:
print a[t[var]],
var = var +1
prints perfectly, thanks so much guys.
Looping over indexes is kinda unpythonic in its
Danny wrote:
I think I should paste some of the programs code a little more of what I
want...
probably...
var = 0
while var = 5:
print a[t[var]]
var = var +1
a is a dectionary (very big) and t is a string of text. (if that's
important right now).
It might be important...
I'm
NateM wrote:
Thank you! If I am reading in dates as strings from a text file, like
5/11/1998, how do I convert that to a format I can pass into mktime?
Thanks again.
Check time.strptime()
--
http://mail.python.org/mailman/listinfo/python-list
Hola,
Aca con una pregunta basica:
A veces veo que hay programas que tienen varias instrucciones en la
misma linea, cuando lo que aprendi de Python era que se usaba el
espaciado para mantener la estructura (indent).
Por ejemplo:
if name != 'comic': return
Hay un return despues de los dos puntos,
I have a file of lines that contains some extraneous chars, this the
basic version of code to process it:
IDtable = .join(map(chr, xrange(256)))
text = file(..., rb).read().translate(IDtable, toRemove)
for raw_line in file(file_name):
line = raw_line.translate(IDtable, toRemove)
...
A
Re-reading my message I noticed a stupid error, not effecting my
problem but annoying, I assigned variables and then did not use them,
then included import cgi for my regular script. This is how the command
line script should look:
#!/usr/bin/python
import MySQLdb
db=MySQLdb.connect(host =
Jeffrey Schwab wrote:
Danny wrote:
Great! It's been solved.
The line, as Glaudio said has a , at the end and that makes it go
onto one line, thanks so much man!
var = 0
while = 5:
print a[t[var]],
var = var +1
prints perfectly, thanks so much guys.
Looping over indexes
This is the result of print sys.path:
print sys.path
['', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4',
'/usr/local/lib/python2.4/plat-linux2',
'/usr/local/lib/python2.4/lib-tk',
'/usr/local/lib/python2.4/lib-dynload',
'/usr/local/lib/python2.4/site-packages']
MySQLdb lives here
Here is the complete error from my Apache error log:
Traceback (most recent call last):
File /var/www/cgi-bin/mysqld_script_test.py, line 7, in ?
import MySQLdb
ImportError: No module named MySQLdb
[Thu Jan 26 07:25:16 2006] [error] [client 127.0.0.1] malformed header
from script. Bad
From what I can tell everything seems right. Here are the results of
the sys.path:
print sys.path
['', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4',
'/usr/local/lib/python2.4/plat-linux2',
'/usr/local/lib/python2.4/lib-tk',
'/usr/local/lib/python2.4/lib-dynload',
if ((data[x][y] 0) or
(datadict.has_key[key])):
Traceback (most recent call last):
File reduce.py, line 524, in remove_badvalues
if ((data[x][y] 0) or
TypeError: unsubscriptable object
However, the bug sits on the next line. I used square brackets when
normal brackets were needed
Jim wrote:
You want to pretty print. Have a look at
http://www.boddie.org.uk/python/XML_intro.html
for example.
Thank you to Paul, I've found that page useful,
Let me know if there's anything else that you think it should cover!
After updating the HTML parsing page and rediscovering some
Fred wrote:
Here is the complete error from my Apache error log:
Traceback (most recent call last):
File /var/www/cgi-bin/mysqld_script_test.py, line 7, in ?
import MySQLdb
ImportError: No module named MySQLdb
[Thu Jan 26 07:25:16 2006] [error] [client 127.0.0.1] malformed header
In article [EMAIL PROTECTED],
Derick van Niekerk [EMAIL PROTECTED] wrote:
.
.
.
I suppose very few books on python start off with HTML processing in
stead of 'hello world' :p
.
.
Say I have some string that begins with an arbitrary sequence of characters
and then alternates repeating the letters 'a' and 'b' any number of times,
e.g.
xyz123aaabbaaabaaaabb
I'm looking for a regular expression that matches the first, and only the
first, sequence of the letter
Hello Roger,
I'm looking for a regular expression that matches the first, and only
the first, sequence of the letter 'a', and only if the length of the
sequence is exactly 3.
import sys, re, os
if __name__=='__main__':
m = re.search('a{3}', 'xyz123aaabbaaaabaaabb')
print
Juho Schultz enlightened us with:
However, the bug sits on the next line. [...] I feel the traceback
is misleading.
Well, the bug sits in the command starting on the line indicated.
Nitpick back: Learn about operator precedence and Python syntax rules.
You don't need so many brackets:
if
Roger L. Cauvin enlightened us with:
I'm looking for a regular expression that matches the first, and
only the first, sequence of the letter 'a', and only if the length
of the sequence is exactly 3.
Your request is ambiguous:
1) You're looking for the first, and only the first, sequence of
Hello,
I am currently trying to write some scripts to get information from the
xmlrpc for redhat network. One of the issues I am having is trying to
strip off the special characters in the hash that is returned. Here is
an example of the information returned within the hash :
===SNIP===
The times that I posted was the time that it took to perform ONE row
iteration. As you can see, the time was going up, fairly dramatically.
Why on earth could it be doing this? I understand the the time will
fluctuate somewhat depending upon what else the CPU is doing, but, why
is the base time
Simon Brunning wrote:
On 1/24/06, Cyril Bazin [EMAIL PROTECTED] wrote:
Does someone ever tried (and succeed) to make an address like
www.website.py.
I found that the .py extension is given to the paraguay.
I found this link ( http://www.nic.py/) but I don't speak spanish...
If
Hi everyone,
Is it possible to write applications using sockets for network
programming on MOBILE Phones( using Python on mobile phones such as
nokia 66* series )
actually i want my mobile to 'TALK' to my pc 'WIRELESSLY' so i can send
data between the two
I think it works over the GPRS stack.
Say I have some string that begins with an arbitrary
sequence of characters and then alternates repeating the
letters 'a' and 'b' any number of times, e.g.
xyz123aaabbaaabaaaabb
I'm looking for a regular expression that matches the
first, and only the first, sequence of the
yqyq22 wrote:
Dear all,
another little question, I use idle 1.1.2, is there a way to use a
history for the command line?
Cursor up to a previously entered line and hit return.
The line will be repeated, allowing editing. If the line
was an entire block, the entire block will be repeated.
On Thu, 2006-01-26 at 09:24, Johhny wrote:
Hello,
I am currently trying to write some scripts to get information from the
xmlrpc for redhat network. One of the issues I am having is trying to
strip off the special characters in the hash that is returned. Here is
an example of the
Sybren Stuvel [EMAIL PROTECTED] wrote:
...
if data[x][y] 0 or datadict.has_key(key):
This might even make things fit on one line again ;-)
Particularly if you code it idiomatically:
if data[x][y] 0 or key in datadict:
Alex
--
http://mail.python.org/mailman/listinfo/python-list
Heiko Wundram [EMAIL PROTECTED] wrote:
bruno at modulix wrote:
Paul McGuire wrote:
or am I taking advantage of a fortuitous accident, which may get
undone at a future time?
It's certainly not a fortuitous accident.
And even the (printed) cookbook has examples which assign to
Hello,
Thankyou for your response,
If I check that the errara_package value is with a print I get the
following.
===SNIP===
Updated libc-client packages that fix a buffer overflow issue are now
available.
This update has been rated as having moderate security impact by the
Red
Hat Security
Tim Chase [EMAIL PROTECTED] wrote:
...
I'm not quite sure what your intent here is, as the
resulting find would obviously be aaa, of length 3.
But that would also match ''; I think he wants negative loobehind
and lookahead assertions around the 'aaa' part. But then there's the
spec
On Thu, 26 Jan 2006 06:39:20 GMT in comp.lang.python, Dennis Lee
Bieber [EMAIL PROTECTED] wrote:
On 25 Jan 2006 12:42:20 -0800, IamIan [EMAIL PROTECTED] declaimed the
following in comp.lang.python:
[...]
I tried print repr(filename) and it returned the actual filename:
'n16w099.asc' ,
On Thu, 2006-01-26 at 09:49, Johhny wrote:
Hello,
Thankyou for your response,
If I check that the errara_package value is with a print I get the
following.
===SNIP===
Updated libc-client packages that fix a buffer overflow issue are now
available.
This update has been rated as having
Derick van Niekerk wrote:
Could you/anyone explain the 4 lines of code to me though? A crash
course in Python shorthand? What does it mean when you use two sets of
brackets as in : beg = [1,0][text.startswith(s1)] ?
It's not as strange as it looks. [1,0] is a list. If you put []
after a list,
Fred wrote:
Slackware Linux 10.2
Heh, Slackware was my first Linux distro. Version
2.2 I think. 1993 maybe?
Everything worked great up to this error when trying to load the
webpage:
ImportError: No module name MySQLdb
Some suggestions:
Start python interactively and try import MySQLdb.
R. Bernstein wrote:
I see how I missed this. Neither disable_.. or enable_.. have document
strings. And neither seem to described in the optparser section (6.21)
of the Python Library (http://docs.python.org/lib/module-optparse.html).
http://docs.python.org/lib/optparse-other-methods.html
--
Magnus Lycka wrote:
Fred wrote:
Slackware Linux 10.2
Heh, Slackware was my first Linux distro. Version
2.2 I think. 1993 maybe?
I have been using Slackware since 1995, version 3.0 kernel 1.2.13
Some suggestions:
Finally, the cgitb module is pretty useful. I
suggest that you look it up:
Hello,
Here is the code (minus my details section).
server = xmlrpclib.ServerProxy(url)
session = server.auth.login(username,password)
#functions.
def getErrata():
channel_label = 'rhel-i386-as-4'
errata =
Johhny wrote:
Hello,
I am currently trying to write some scripts to get information from the
xmlrpc for redhat network. One of the issues I am having is trying to
strip off the special characters in the hash that is returned. Here is
an example of the information returned within the hash :
Christoph Conrad [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hello Roger,
I'm looking for a regular expression that matches the first, and only
the first, sequence of the letter 'a', and only if the length of the
sequence is exactly 3.
import sys, re, os
if
On Thu, 26 Jan 2006 01:12:10 -0600
Runsun Pan [EMAIL PROTECTED] wrote:
For the tests that I tried earlier, using han characters
as the variable names doesn't seem to be possible (Syntax
Error) in python. I'd love to see if I can use han char
for all those keywords like import, but it doesn't
Alex Martelli [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Tim Chase [EMAIL PROTECTED] wrote:
...
I'm not quite sure what your intent here is, as the
resulting find would obviously be aaa, of length 3.
But that would also match ''; I think he wants negative loobehind
and
Johhny wrote:
for vals in errata:
print %s\t\t%s\t\t%s\t%s\t%s %
(vals['errata_advisory'],vals['errata_issue_date'],vals['errata_update_date'],vals['errata_last_modified_date'],vals['errata_type'],
)
errata_info = getPackage(vals['errata_advisory'],)
print
Johhny wrote:
Hello,
Here is the code (minus my details section).
server = xmlrpclib.ServerProxy(url)
session = server.auth.login(username,password)
#functions.
def getErrata():
channel_label = 'rhel-i386-as-4'
errata =
On Thu, 26 Jan 2006 14:09:54 GMT, rumours say that Roger L. Cauvin
[EMAIL PROTECTED] might have written:
Say I have some string that begins with an arbitrary sequence of characters
and then alternates repeating the letters 'a' and 'b' any number of times,
e.g.
xyz123aaabbaaabaaaabb
On 25 Jan 2006 09:35:50 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
thx! indeed, it worked -- took me some time to figure out how to
implement the setting of attributes, too. i finally managed to get that
done using super:
Seems good.
snip
the ``~.__setattr__()`` method tests for the
On 2006-01-26, al pacino [EMAIL PROTECTED] wrote:
Is it possible to write applications using sockets for network
programming on MOBILE Phones( using Python on mobile phones
such as nokia 66* series )
actually i want my mobile to 'TALK' to my pc 'WIRELESSLY' so i can send
data between the
Hello Roger,
since the length of the first sequence of the letter 'a' is 2. Yours
accepts it, right?
Yes, i misunderstood your requirements. So it must be modified
essentially to that what Tim Chase wrote:
m = re.search('^[^a]*a{3}b', 'xyz123aabbaaab')
Best wishes from germany,
Sybren Stuvel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Roger L. Cauvin enlightened us with:
I'm looking for a regular expression that matches the first, and
only the first, sequence of the letter 'a', and only if the length
of the sequence is exactly 3.
Your request is
Sorry for the confusion. The correct pattern should reject
all strings except those in which the first sequence of the
letter 'a' that is followed by the letter 'b' has a length of
exactly three.
Ah...a little more clear.
r = re.compile([^a]*a{3}b+(a+b*)*)
matches = [s for s
On 25 Jan 2006 12:42:20 -0800, IamIan [EMAIL PROTECTED] wrote:
Thank you for the replies, I'm new to Python and appreciate your
patience. I'm using Python 2.1.
To reiterate, the ASCII files in the workspace are being read correctly
and their latitude values (coming from the filenames) are
Hello,
In response to that the output is this :
type 'str' 'Updated libc-client packages that fix a buffer overflow
issue are now\navailable.\n\nThis update has been rated as having
moderate security impact by the Red\nHat Security Response Team.'
--
Terry Hancock wrote:
One thing that I also think would be good is to open up the
operator set for Python. Right now you can overload the
existing operators, but you can't easily define new ones.
And even if you do, you are very limited in what you can
use, and understandability suffers.
One
Farshid Lashkari [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
The problem is that PyObject_CallObject always returns NULL. Is this the
correct return value for simply executing a script, as there is no
function
return value involved?
The documentation for PyObject_CallObject
I am trying to download some html using mechanize:br=Browser()r = br.open(url)b = r.read()print bI have used this code successfully many times and now I have run across an instance where it fails. It opens the url without error but then prints nothing.
Looking at the http headers when it works
(since this is a newsgroup, can you please quote the message
you're replying to).
Johhny wrote:
In response to that the output is this :
type 'str' 'Updated libc-client packages that fix a buffer overflow
issue are now\navailable.\n\nThis update has been rated as having
moderate security
On Wed, 18 Jan 2006 18:31:39 -0500, Bernard Lebel [EMAIL PROTECTED] wrote:
I'm absolutely flabbergasted.
Your suggestion worked, the loop now picks up the changed values, and
without the need to reconnect.
It's the first time I have to commit after a query, up until I wrote
this program, I
Tim Chase [EMAIL PROTECTED] wrote:
Sorry for the confusion. The correct pattern should reject
all strings except those in which the first sequence of the
letter 'a' that is followed by the letter 'b' has a length of
exactly three.
Ah...a little more clear.
r =
Hallo Alex,
r = re.compile([^a]*a{3}b+(a+b*)*) matches = [s for s in
listOfStringsToTest if r.match(s)]
Unfortunately, the OP's spec is even more complex than this, if we are
to take to the letter what you just quoted; e.g. aazaaab SHOULD match,
Then it's again a{3}b, isn't it?
Freundliche
Tim Chase [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Sorry for the confusion. The correct pattern should reject
all strings except those in which the first sequence of the
letter 'a' that is followed by the letter 'b' has a length of
exactly three.
Ah...a little more clear.
yqyq22 wrote:
Dear all,
another little question, I use idle 1.1.2, is there a way to use a
history for the command line?
thanks in advance
Another possibility beside going to any of the previous lines and
hitting [Return]:
[Alt]+p
Claudio
--
Christos Georgiou [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Thu, 26 Jan 2006 14:09:54 GMT, rumours say that Roger L. Cauvin
[EMAIL PROTECTED] might have written:
Say I have some string that begins with an arbitrary sequence of
characters
and then alternates repeating the
r = re.compile([^a]*a{3}b+(a+b*)*)
matches = [s for s in listOfStringsToTest if r.match(s)]
Wow, I like it, but it allows some strings it shouldn't. For example:
xyz123aabbaaab
(It skips over the two-letter sequence of 'a' and matches 'bbaaab'.)
Anchoring it to the beginning/end might
Roger L. Cauvin wrote:
Sorry for the confusion. The correct pattern should reject all strings
except those in which the first sequence of the letter 'a' that is followed
by the letter 'b' has a length of exactly three.
Hope that's clearer . . . .
Examples are a *really* good way to
Tim Chase [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
r = re.compile([^a]*a{3}b+(a+b*)*)
matches = [s for s in listOfStringsToTest if r.match(s)]
Wow, I like it, but it allows some strings it shouldn't. For example:
xyz123aabbaaab
(It skips over the two-letter sequence of 'a'
SPE - Stani's Python Editor wrote:
Release news from http://pythonide.stani.be
This is an important a bugfix release for all platforms. As new
features it can customize your fonts and colors (styles), supports
interactive terminals and has improved support for Ubuntu.
Thanks to Marco
Peter Hansen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Roger L. Cauvin wrote:
Sorry for the confusion. The correct pattern should reject all strings
except those in which the first sequence of the letter 'a' that is
followed by the letter 'b' has a length of exactly three.
Christoph Conrad [EMAIL PROTECTED] wrote:
Hello Roger,
since the length of the first sequence of the letter 'a' is 2. Yours
accepts it, right?
Yes, i misunderstood your requirements. So it must be modified
essentially to that what Tim Chase wrote:
m = re.search('^[^a]*a{3}b',
I have a Python UDP listener socket that waits for incoming data. The
socket runs as an endless loop. I would like to pop the incoming data
into an existing Tkinter app that I have created. What's the
easiest/most efficient way of handling this? Would I create a separate
thread that has the
On Thu, 26 Jan 2006 16:26:57 GMT, rumours say that Roger L. Cauvin
[EMAIL PROTECTED] might have written:
Christos Georgiou [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Thu, 26 Jan 2006 14:09:54 GMT, rumours say that Roger L. Cauvin
[EMAIL PROTECTED] might have written:
Say I
Rocco Moretti wrote:
Terry Hancock wrote:
One thing that I also think would be good is to open up the
operator set for Python. Right now you can overload the
existing operators, but you can't easily define new ones.
And even if you do, you are very limited in what you can
use, and
Alex Martelli [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Tim Chase [EMAIL PROTECTED] wrote:
Sorry for the confusion. The correct pattern should reject
all strings except those in which the first sequence of the
letter 'a' that is followed by the letter 'b' has a length of
On Thu, 26 Jan 2006 16:41:08 GMT, rumours say that Roger L. Cauvin
[EMAIL PROTECTED] might have written:
Good suggestion. Here are some test cases:
xyz123aaabbab accept
xyz123aabbaab reject
xayz123aaabab accept
xaaayz123abab reject
xaaayz123aaabab accept
Applying my last regex to your test
I have discovered the possible problem (I can't check this until later
when I am home)
I think when I upgraded to Python 2.4.2 it created my problem.
Below is what is going on:
Default Slackware 10.2 install - 2.4.1 installed into
/usr/lib/python2.4
Python 2.4.1 upgraded to 2.4.2
Upgrade
1 - 100 of 235 matches
Mail list logo