"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_
On Thu, 26 Jan 2006, Pete Forman wrote:
> In an article about the Royal Bank of Scotland working with Zope there
> is this quote from Gary Barnett, a research director at analyst firm
> Ovum:
>
> "A lot of banks are using applications like Apache and Perl, but
> it's interesting to see they're u
How does
http://beta.python.org/about/beginners/
look?
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-01-26, Steve Holden <[EMAIL PROTECTED]> wrote:
> gregarican wrote:
>> 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/mos
Hi all,
I've read some thread about isinstance(), why it is considered harmful
and how you can achieve the same results using a coding style that
doesn't break polymorphism etc... Since I'm trying to improve my Python
knowledge, and I'm going to design a class hierarchy from scratch, I'd
like to ha
The below seems to pass all the tests you threw at it (taking the
modified 2nd test into consideration)
One other test that occurs to me would be
"xyz123aaabbaaabab"
where you have "aaab" in there twice.
-tkc
import re
tests = [
("xyz123aaabbab",True),
("xyz123aabbaaab", False),
("xay
I've been working on an external C module for Python in order to use
some of the functionality from Ethereal. Right now I'm getting
segfaults originating from within the Ethereal source code, but the
same code works fine when used normally (i.e. through Ethereal or
Tethereal). I'm wondering if ther
I have a dll that contains all kinds of services (input, audio, video,
etc..), and I would like to export these to Python as separate modules.
Now, if I call Py_InitModule with a name that's different than the dll
name, I get an error. So what can I do?
Thanks,
Andras
--
http://mail.python.o
On 26 Jan 2006 08:46:11 -0800, gregarican <[EMAIL PROTECTED]> wrote:
>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 wa
On 1/26/06, Terry Hancock <[EMAIL PROTECTED]> wrote:
> On Thu, 26 Jan 2006 01:12:10 -0600
> Runsun Pan <[EMAIL PROTECTED]> wrote:
> > Error) in python. I'd love to see if I can use han char
> > for all those keywords like import, but it doesn't work.
>
> Yeah, I'm pretty sure we're talking about th
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Roger L. Cauvin wrote:
>
>> > $ python test.py
>> > gotexpected
>> > ---
>> > accept accept
>> > reject reject
>> > accept accept
>> > reject reject
>> > accept accept
>>
>> Thanks, but the second test ca
gregarican wrote:
> 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
>
Magnus Lycka informs:
> [in response to my comment]:
> > 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.py
when POSTing a date from an mod_python psp page to another the date is
sent as a string. I'm using form.has_key to pull the POST. I can cut
the string up,turn the strings into integers and then use
datetime.datetime(y,m,d,hr,mn,se) to create a proper datetime. Is
there a simpler way of doing this
"Christos Georgiou" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Thu, 26 Jan 2006 17:09:18 GMT, rumours say that "Roger L. Cauvin"
> <[EMAIL PROTECTED]> might have written:
>
>>Thanks, but the second test case I listed contained a typo. It should
>>have
>>contained a sequence
Roger L. Cauvin wrote:
> > $ python test.py
> > gotexpected
> > ---
> > accept accept
> > reject reject
> > accept accept
> > reject reject
> > accept accept
>
> Thanks, but the second test case I listed contained a typo. It should have
> contained a sequence of three of the lette
"Christos Georgiou" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Thu, 26 Jan 2006 18:01:07 +0100, rumours say that "Fredrik Lundh"
> <[EMAIL PROTECTED]> might have written:
>
>>Roger L. Cauvin wrote:
>>
>>> Good suggestion. Here are some "test cases":
>>>
>>> "xyz123aaabbab" a
In an article about the Royal Bank of Scotland working with Zope there
is this quote from Gary Barnett, a research director at analyst firm
Ovum:
"A lot of banks are using applications like Apache and Perl, but
it's interesting to see they're using Python and Zope as it's
moderately hardcore
Bo Peng a écrit :
> Travis E. Oliphant wrote:
>
>> On Linux you can use oprofile (which is pretty nice and easy to use
>> --- no recompiling. Just start the profiler, run your code, and stop
>> the profiler).
>
>
> Thank you very much for the tip. This is a great tool.
>
> The source of the
On Thu, 26 Jan 2006 17:09:18 GMT, rumours say that "Roger L. Cauvin"
<[EMAIL PROTECTED]> might have written:
>Thanks, but the second test case I listed contained a typo. It should have
>contained a sequence of three of the letter 'a'. The test cases should be:
>
>"xyz123aaabbab" accept
>"xyz123
Steve Holden <[EMAIL PROTECTED]> writes:
> Well you are just as capable ...
Yes, I guess you are right. Done.
Couldn't find how to suggest an addition to the Python Cookbook (other
than some generic O'Reilly email), so I've put a submission to:
http://aspn.activestate.com/ASPN/Cookbook/Python/
-
"Christos Georgiou" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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 Ja
"Christos Georgiou" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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
>>
On Thu, 26 Jan 2006 18:01:07 +0100, rumours say that "Fredrik Lundh"
<[EMAIL PROTECTED]> might have written:
>Roger L. Cauvin wrote:
>
>> Good suggestion. Here are some "test cases":
>>
>> "xyz123aaabbab" accept
>> "xyz123aabbaab" reject
>> "xayz123aaabab" accept
>> "xaaayz123abab" reject
>> "xaa
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Roger L. Cauvin wrote:
>
>> Good suggestion. Here are some "test cases":
>>
>> "xyz123aaabbab" accept
>> "xyz123aabbaab" reject
>> "xayz123aaabab" accept
>> "xaaayz123abab" reject
>> "xaaayz123aaabab" accept
>
> $ more
Alex Martelli a écrit :
> Fredrik Lundh <[EMAIL PROTECTED]> wrote:
>...
>
>>the obvious solution is
>>
>>item = list(s)[0]
>>
>>but that seems to be nearly twice as slow as [x for x in s][0]
>>under 2.4. hmm.
>
>
> Funny, and true on my laptop too:
>
> helen:~ alex$ python -mtimeit -s
On Thu, 19 Jan 2006 10:47:35 GMT, rumours say that "Giovanni Bajo"
<[EMAIL PROTECTED]> might have written:
>I have a generic solution for this (never submitted to the cookbook... should
>I?)
This is by Andrew Durdin:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303439
This is by me:
On Thu, 26 Jan 2006 16:26:57 GMT in comp.lang.python, "Roger L.
Cauvin" <[EMAIL PROTECTED]> wrote:
>"Christos Georgiou" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
[...]
>> Is this what you mean?
>>
>> ^[^a]*(a{3})(?:[^a].*)?$
>
>Close, but the pattern should allow "arbitrary seq
"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_
Dear list,
This may sound strange but I need to start a python shell from python.
The motivation is that I have a bunch of (numeric) python functions to
provide to a user. The best way I can think of is packing my python
module using py2exe, and because it is easiest to let him run the
functio
I think I find what I need:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/355319
Bo
--
http://mail.python.org/mailman/listinfo/python-list
Roger L. Cauvin wrote:
> Good suggestion. Here are some "test cases":
>
> "xyz123aaabbab" accept
> "xyz123aabbaab" reject
> "xayz123aaabab" accept
> "xaaayz123abab" reject
> "xaaayz123aaabab" accept
$ more test.py
import re
print "gotexpected"
print "-- "
testsuite = (
("x
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 downloa
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
"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'
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, a
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
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 listene
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
"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 exact
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 Mar
"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 t
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 c
>>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 beginnin
"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
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
--
http://mail.python.org/mailman/listinfo/py
"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
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?
Fr
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 = re
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 pro
(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 :
>
> 'Updated libc-client packages that fix a buffer overflow
> issue are now\navailable.\n\nThis update has been rated as having
> moderate security impact b
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 fi
Hello All,
thanks for your help. I got it working and learnt some more things
which is always great. Your assitance has been very useful.
Regards,
Johhny
--
http://mail.python.org/mailman/listinfo/python-list
"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_
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.
Hello,
In response to that the output is this :
'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.'
--
http://mail.python.org/mailman/listinfo/python-list
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) ar
> 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
"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 req
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,
Christo
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
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.
>
>the ``~.__setattr__()`` method tests for the s
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.
>
>"xyz123aaabbaaaba
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 Ferreira there will be very soon a debian pack
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 =
> server.channel.software.list_err
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 errata_info['err
"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
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 does
"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 _
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 ha
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 =
server.channel.software.list_errata(session,channel_label,start_date,end_date)
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 loo
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
--
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 MySQLd
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
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
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'
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
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 Respo
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
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
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 infor
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.
> 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
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.
P
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.
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 inc
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===
{'errata_
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
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 dat
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 m
Sebastian Bassi wrote:
> Por ejemplo:
> if name != 'comic': return
> Hay un return despues de los dos puntos, no se que significa.
I can't write spanish, but nevertheless maybe an english answer is of help.
Yes, it's allowed to write that, and it is the same as:
if name != 'comic':
return
Yo
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 'a
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
.
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 he
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
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 nee
>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',
'/usr/local/lib/
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 head
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
101 - 200 of 236 matches
Mail list logo