Paolo Veronelli wrote:
> Yes this is really strange.
>
> from sets import Set
> class H(Set):
> def __hash__(self):
> return id(self)
>
> s=H()
> f=set() #or f=Set()
>
> f.add(s)
> f.remove(s)
>
> No errors.
>
> So we had a working implementation of sets in the library an put a
> broken
I found a good solution to this problem in Richard Steven's
_Network_Programming_. It seems like everything shows up in Steven's
books! Rather than pausing, you do a blocking read on a pipe. You
only write to the pipe from within the signal handler. However, this
brings up the better question:
I use the following
###
import re
Results=[]
data1=''
ID = re.compile(r'^.*=(\d+)&.*$',re.MULTILINE)
Results=re.findall(ID,data1)
print Results
#
to extract from data1 all numbers such as 15015,15016,15017
But the program extracts only the last number 15017.
Why?
Thank you
On Thu, 11 Aug 2005 15:02:08 -0400
Terry Reedy wrote:
> I remember discussion of the LSP on comp.object some years ago when I
> was reading it. (I presume there still are, just don't read it
> anymore.). One of the problems is that biology and evolution do not
> obey it. Birds (in general) c
Thanks for your help.
--
http://mail.python.org/mailman/listinfo/python-list
Hi all
I am using win32 odbc to connect to SQL Server. I have just started
using the 'bit' data type, which is a boolean type which can store 1 or
0.
This works with win32, but it returns '1' or '0'. Obviously I can
change it to an int, but it would be nicer and more correct if it
returned an int
Thanks guys! Your explanations have cleared up things significantly.
My transition from C++ to Java to C# was quite painless because they
were so similar, but Python is particularly challenging because the
concepts are quite different. (I always have this paranoid feeling: "Am
I using Python to wr
Instance variables are typically defined in __init__(), but they can be
added to an object anywhere. The only exception is when defining the
magic __slots__ class variable to pre-define what the allowed instance
variables can be.
class A:
pass
a = A()
a.instVar1 = "hoo-ah"
a.instVar2 = "another
Try this:
>>> a,b,c = list('tab'),list('era'),list('net')
>>> a,b,c
(['t', 'a', 'b'], ['e', 'r', 'a'], ['n', 'e', 't'])
>>> tuple(((x,y,z) for x,y,z in zip(a,b,c)))
(('t', 'e', 'n'), ('a', 'r', 'e'), ('b', 'a', 't'))
>>>
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
Ray <[EMAIL PROTECTED]> wrote:
> 1. Where are the access specifiers? (public, protected, private)
No such thing (or, if you like, everything is "private" by default).
By convention, "please don't access this name externally" is indicated
by using the name '_foo' instead of 'foo'; similar to a "pr
"zxo102" <[EMAIL PROTECTED]> writes:
> Hi,
>I got several dynamic lists a1, b1, c1, from a python
> application such as
>a1 = [1,5,3,2,5,...], the len(a1) varies. Same to b1, c1,
>
>With python, I would like to reorganize them into a tuple like
>
>t1 = ((a1[0],b1[0],c1[0]
Try the zip funciton:
py> a = [11,12,13,14]
py> b = [2,3,4,5]
py> c = [20,21,22,23,24,25]
py> zip(a,b,c)
[(11, 2, 20), (12, 3, 21), (13, 4, 22), (14, 5, 23)]
On Thursday 11 August 2005 09:05 pm, zxo102 wrote:
> Hi,
>I got several dynamic lists a1, b1, c1, from a python
> application
Hi
I am relatively new to Python.
I am using Qt Designer to create a UI for a measurement application that I
use.
Everything seems to be clear but the use of globals (defined in the module
that is generated using pyuic, that contains the form class).
I am using qwtplot to display a running plot
Nodir Gulyamov wrote:
> [...]I should show you real code
[...]
> Please find below real code. Sorry for amount of sources.
Yeah, it's too much for me. Can you construct a minimal
example that doesn't do what you think it should?
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-li
Please look through this example code, and the comments. If I've
misspoken, please anyone correct my errors.
-- Paul
class OldStyleClass:
"""A definition of an old style class."""
pass
class NewStyleClass(object):
"""Note that NewStyleClass explicitly inherits from object. This
kyo guan wrote:
> How to Adding Functionality to a Class by metaclass(not by inherit)
>
[snip]
>
> class MetaFoo(type):
> def __init__(cls, name, bases, dic):
> super(MetaFoo, cls).__init__(name, bases, dic)
>
> for n, f in inspect.ge
Xah Lee is a known troll. You are retarded to reply to his drivel.
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
Lenny G. wrote:
> I use 's = os.read(fd, 12)' to grab 12 bytes from a file. Now, I want
> to create a string, s1, which contains 16-12=4 bytes: 4,0,0,0, followed
> by the contents of s.
>
> I know how to 's1 = "\x04\x00\x00\x00"' and how to 's3 = s1+s', but I
> don't know how to construct s1
John Machin wrote:
[...]
> Observation: factoring out the compile step makes the difference much
> more apparent.
>
> >>> ["%.3f" % t.timeit() for t in t3, t4, t5, t6]
> ['1.578', '1.175', '2.283', '1.174']
> >>> ["%.3f" % t.timeit() for t in t3, t4, t5, t6]
> ['1.582', '1.179', '2.284', '
I am sorry if I think like this, but sometimes(keyword sometimes) I like
distributing my interpreters.
Anyway, I found the absolute minimum libraries needed for Python to work
with Win32. And, I included FLTK for the GUI toolkit. Sorry, but
wxPython didn't fit my <30MB requirement.
You can b
Ray wrote:
> Devan L wrote:
>
>>Fausto Arinos Barbuto wrote:
>>
>>>Ray wrote:
>>>
>>>
1. Where are the access specifiers? (public, protected, private)
>>>
>>>AFAIK, there is not such a thing in Python.
>>>
>>>---Fausto
>>
>>Well, technically you can use _attribute to mangle it, but technic
Ray wrote:
> 1. Where are the access specifiers? (public, protected, private)
There's no enforceable way of doing these. The convention is that names
that begin with a single underscore are private to the
class/module/function/etc. Hence why sys._getframe() is considered a
hack -- it's not of
Hi Steve;
Steve M wrote:
>> First, I tried the usual "python setup.py install" but that did not work.
> How exactly did it fail? Perhaps you can paste the error output from
> this command.
Sure, he is the output:
linux:/home/fausto/Documents/psyco-1.4 # python setup.py install
PROCES
How to Adding Functionality to a Class by metaclass(not by inherit)
#example:
import inspect
class Foo(object):
def f(self):
pass
def g(self):
pass
class MetaFoo(type):
def __init__(cls, name, bases, dic):
Wow, thanks for all the quick responses!
Martin wrote:
> the PEP author is typically expected to implement the proposed
> functionality (in many cases, having a draft implementation is
> prerequisite to accepting it).
Fuzzyman wrote:
> ...you could take your proposal forward by developing a set o
How to Adding Functionality to a Class by metaclass(not by inherit)
#example:
import inspect
class Foo(object):
def f(self):
pass
def g(self):
pass
class MetaFoo(type):
def __init__(cls, name, bases, dic):
I use 's = os.read(fd, 12)' to grab 12 bytes from a file. Now, I want
to create a string, s1, which contains 16-12=4 bytes: 4,0,0,0, followed
by the contents of s.
I know how to 's1 = "\x04\x00\x00\x00"' and how to 's3 = s1+s', but I
don't know how to construct s1 dynamically (i.e., given N, cons
Roedy Green <[EMAIL PROTECTED]> writes:
> On 11 Aug 2005 18:23:42 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote or
> quoted :
[ the usual nonsense ]
>
> Jargon [...]
[snip]
Take a look at the Newsgroups: line. Then look for other articles Xah
Lee has posted, and see if you can make sense of any of t
But when I can't find a way for a long time, I'll be upset.
On 8/12/05, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> Magnus Lie Hetland wrote:
> > Just saw this on the BBC World program Click Online:
> >
> >
> > http://bbcworld.com/content/template_clickonline.asp?pageid=665&co_pageid=6
> >
> > I m
John Machin wrote:
> Steven Bethard wrote:
[...]
>> BTW, a simpler example of the same phenomenon is:
>>
>> py> range(10)[slice(None, None, -2)]
>> [9, 7, 5, 3, 1]
>> py> slice(None, None, -2).indices(10)
>> (9, -1, -2)
>> py> range(10)[9:-1:-2]
>> []
>>
>
> >>> rt = range(10)
> >>>
Hi,
I got several dynamic lists a1, b1, c1, from a python
application such as
a1 = [1,5,3,2,5,...], the len(a1) varies. Same to b1, c1,
With python, I would like to reorganize them into a tuple like
t1 = ((a1[0],b1[0],c1[0],...),(a1[1],b1[1],c1[1],...),...)
Anybody knows
as I know , agrep can handle this , at least the newer version from
http://www.tgries.de/agrep/index.html with a -f property.
here is a agrep port to python
http://www.bio.cam.ac.uk/~mw263/pyagrep.html, but it is some out of
date, and in it's discription "matching of multiple input patterns is
def
> First, I tried the usual "python setup.py install" but that did not work.
How exactly did it fail? Perhaps you can paste the error output from
this command.
--
http://mail.python.org/mailman/listinfo/python-list
Magnus Lie Hetland wrote:
> Just saw this on the BBC World program Click Online:
>
> http://bbcworld.com/content/template_clickonline.asp?pageid=665&co_pageid=6
>
> I must say, I think this is the first time I've heard Python discussed
> on TV at all... Cool :)
>
> (Now maybe I'll have to fini
Just curious if anyone's aware of a good recipe for setting up SSL access to
postgresql for pgdb (or another appropriate db-sig 2 compliant module). Or
any good recommendations/considerations e.g. m2crypto with pgdb.
jamie
--
http://mail.python.org/mailman/listinfo/python-list
Devan L wrote:
> Fausto Arinos Barbuto wrote:
> > Ray wrote:
> >
> > > 1. Where are the access specifiers? (public, protected, private)
> >
> > AFAIK, there is not such a thing in Python.
> >
> > ---Fausto
>
> Well, technically you can use _attribute to mangle it, but technically
> speaking, th
def descend(iterable):
if hasattr(iterable, '__iter__'):
for element in iterable:
descend(element)
else:
do_something(iterable)
This will just do_something(object) to anything that is not an
iterable. Only use it if all of your nested structures are of the same
Fausto Arinos Barbuto wrote:
> Ray wrote:
>
> > 1. Where are the access specifiers? (public, protected, private)
>
> AFAIK, there is not such a thing in Python.
So everything is public? I know that you can prefix a member with
underscores to make something private, but how about protected, for
Fausto Arinos Barbuto wrote:
> Ray wrote:
>
> > 1. Where are the access specifiers? (public, protected, private)
>
> AFAIK, there is not such a thing in Python.
>
> ---Fausto
Well, technically you can use _attribute to mangle it, but technically
speaking, there are no public, protected, or pr
On 8/11/05, Steve M <[EMAIL PROTECTED]> wrote:
> Kristian Zoerhoff wrote:
>
> > On 8/11/05, Steve M <[EMAIL PROTECTED]> wrote:
> >> Hello,
> >>
> >>I'm having problems sending information from a python
> >> script to a printer. I was wondering if someone might send me
> >> in the right dir
Ray wrote:
> 1. Where are the access specifiers? (public, protected, private)
AFAIK, there is not such a thing in Python.
---Fausto
--
http://mail.python.org/mailman/listinfo/python-list
Hi All;
I have Psyco (on Windows XP) and now I want to install it on Linux, too.
I FTP'd the tarball (tar.gz) from Psyco's site but can't get it compiled.
First, I tried the usual "python setup.py install" but that did not work.
I later found a RPM for Psyco but it wasn't suitable
On 11 Aug 2005 18:23:42 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote or
quoted :
>The Jargons of
>marketing came from business practice, and they can be excusable
>because they are kinda a necessity or can be considered as a naturally
>evolved strategy for attracting attention in a laissez-faire eco
Hello,
I've been learning Python in my sparetime. I'm a Java/C++ programmer by
trade. So I've been reading about Python OO, and I have a few questions
that I haven't found the answers for :)
1. Where are the access specifiers? (public, protected, private)
2. How does Python know whether a class i
I'm a real Python NEWB and am intrigued by some of Python's features, so I'm
starting to write code to do some things to see how it works. So far I
really like the lists and dictionaries since I learned to love content
addressability in MATLAB. I was wondering it there's a simple routine (I
think
Steven Bethard wrote:
> Bryan Olson wrote:
>
>>
>> class BuggerAll:
>>
>> def __init__(self, somelist):
>> self.sequence = somelist[:]
>>
>> def __getitem__(self, key):
>> if isinstance(key, slice):
>> start, stop, step = key.indices(len(
Thanks. I adapted it a bit:
def debug(foo):
print foo, 'is:'
exec('pprint.pprint(' + foo + ')')
But I'm getting "NameError: name 'foo' is not defined," since foo is
not defined in this scope. (The function works beautifully when I'm
dealing with global variables, which is very rarely).
A
Rex Eastbourne wrote:
> def debug(aname, avalue):
> print aname, 'is':
> pprint.pprint(avalue)
>
use eval:
def debug(s):
print s, 'is'
pprint.pprint(eval(s))
(it does mean the arg is a string not code..)
> On a
> slightly different topic, is it also possible to ma
> David Isaac wrote:
> > I am looking for a pure Python secure ftp solution.
> > Does it exist?
"Andrew MacIntyre" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I recall coming across an extension package (pretty sure it wasn't pure
> Python anyway, certainly not for the SSL bits)
Bengt Richter wrote:
[name for dec,name in sorted((int(nm.split('.')[1]),nm) for nm in namelist)]
>
> ['test.1', 'test.2', 'test.3', 'test.4', 'test.10', 'test.15', 'test.20']
Giving a key argument to sorted will make it simpler::
>>> sorted(namelist, key=lambda x:int(x.rsplit('.')[-1]))
--
Steven Bethard wrote:
> I suspect there's a reason that it's done this way, but I agree with you
> that this seems strange. Have you filed a bug report on Sourceforge?
I gather that the slice class is young, so my guess is bug. I
filed the report -- my first Sourceforge bug report.
> BTW, a s
[Format recovered from top posting]
Jeremy Moles <[EMAIL PROTECTED]> writes:
> On Thu, 2005-08-11 at 14:04 -0700, Rex Eastbourne wrote:
>> Hi all,
>>
>> I've written the following simple macro called debug(aname, avalue)
>> that prints out the name of an expression and its value:
>>
>> def debug
Xah Lee wrote:
> Jargons of Info Tech industry
>
> (A Love of Jargons)
>
> Xah Lee, 2002 Feb
>
> People in the computing field like to spur the use of spurious
> jargons. The less educated they are, the more they like extraneous
[...]
Just for the records at Google et.al. in case someone stumbles
Darren Dale wrote:
> Thanks, I didnt realize that \r is different from \n.
\r has is a byte with value 13, which is the Carriage Return (CR)
control character in ASCII. \n has value 10 and is the Line Feed (LF)
character. CR is named after the old teletypewriter operation involving
moving the
[EMAIL PROTECTED] wrote:
> disregard the C example. wasn't checking the return code of
> pthread_create. the C program breaks in the same place, when creating
> the 1021st thread.
So that's pretty good evidence that it's an OS limit, not a
Python limit. The most likely problem is that the sta
Dan <[EMAIL PROTECTED]> writes:
>> The server should accept connections from new players and be able to handle
>> multiple games concurrently.
>
> Multiple threads would be the way to go for a real application. But if
> you want to avoid the complexity involved in threading and
> synchronization
Hi All--
Erik Max Francis wrote:
>
> Xah Lee wrote:
>
> > Jargons of Info Tech industry
> >
> > (A Love of Jargons)
> >
> > Xah Lee, 2002 Feb
>
> Congratulations, this time you managed to get to your second paragraph
> before your Tourette's kicked in.
>
You made it that far? Congratulations
Python 2.3.4 (#1, May 29 2004, 17:05:23)
[GCC 3.3.3] on linux2
Getting some strange behaviour with keyword arguments for optional
arguments in extension modules. See the simple test case below
8<--
#include "Python.h"
static PyObject *
ke
Xah Lee wrote:
> Jargons of Info Tech industry
>
> (A Love of Jargons)
>
> Xah Lee, 2002 Feb
Congratulations, this time you managed to get to your second paragraph
before your Tourette's kicked in.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 3
Jargons of Info Tech industry
(A Love of Jargons)
Xah Lee, 2002 Feb
People in the computing field like to spur the use of spurious jargons.
The less educated they are, the more they like extraneous jargons, such
as in the Unix & Perl community. Unlike mathematicians, where in
mathematics there a
On Fri, 12 Aug 2005 00:06:17 GMT, Peter A. Schott <[EMAIL PROTECTED]> wrote:
>Trying to operate on a list of files similar to this:
>
>test.1
>test.2
>test.3
>test.4
>test.10
>test.15
>test.20
>
>etc.
>
>I want to sort them in numeric order instead of string order. I'm starting
>with
>this code:
Kristian Zoerhoff wrote:
> On 8/11/05, Steve M <[EMAIL PROTECTED]> wrote:
>> Hello,
>>
>>I'm having problems sending information from a python
>> script to a printer. I was wondering if someone might send me
>> in the right direction. I wasn't able to find much by Google
>
> Which platfo
On 8/11/05, Steve M <[EMAIL PROTECTED]> wrote:
> Hello,
>
>I'm having problems sending information from a python
> script to a printer. I was wondering if someone might send me
> in the right direction. I wasn't able to find much by Google
Which platform? Directions will vary wildly.
--
Hi man! I found a post of yours in wich you tell
that you use pcapy python module to capture packets.
I need to do something similar but unfortunately I
can't find too much domentation (and example codes) about this library.
Can you paste me a simple code in wich you use
this module for
In article <[EMAIL PROTECTED]>,
Ramza Brown <[EMAIL PROTECTED]> wrote:
>
>Can you distribute a python system with only a couple of libraries that
>you plan to use. For example, I generally avoid having a system with
>hundreds of loose scripts(ie python library). So, I have considered
>only ta
Hello,
I'm having problems sending information from a python
script to a printer. I was wondering if someone might send me
in the right direction. I wasn't able to find much by Google
TIA
Steve
--
http://mail.python.org/mailman/listinfo/python-list
Trying to operate on a list of files similar to this:
test.1
test.2
test.3
test.4
test.10
test.15
test.20
etc.
I want to sort them in numeric order instead of string order. I'm starting with
this code:
import os
for filename in [filename for filename in os.listdir(os.getcwd())]:
print
Steven Bethard wrote:
> def __call__(cls, *args, **kwargs):
> obj = cls.__new__()
> if not isinstance(obj.__class__, cls):
^^
issubclass
> return obj
> obj.__class__.__init__(obj, *args, **kwargs)
> return obj
STeVe
--
http://mail.pytho
Ramza Brown wrote:
> Can you distribute a python system with only a couple of libraries that
> you plan to use. For example, I generally avoid having a system with
> hundreds of loose scripts(ie python library). So, I have considered
> only taking the libraries I need. My question, is python
aurora wrote:
> This test somehow water down the n^2 issue. The problem is in the depth
> of recursion, in this case it is only log(n). It is probably more
> interesting to test:
>
> def gen(n):
> if n:
> yield n
> for i in gen(n-1):
> yield i
You should be
Title: Can't start new thread
I am trying to understand what is causing python to raise this error when I create a number of threads:
thread.error: can't start new thread
I have been told that it is due to the default thread size (1 MB), but I have recompiled python defining an alternate
Bengt Richter wrote:
> On Thu, 11 Aug 2005 15:43:23 -0400, Darren Dale <[EMAIL PROTECTED]> wrote:
>
>>Peter Hansen wrote:
>>
>>> Darren Dale wrote:
Is there a module somewhere that intelligently deals with reports to
the command line? I would like to report the progress of some pretty
>
Can you distribute a python system with only a couple of libraries that
you plan to use. For example, I generally avoid having a system with
hundreds of loose scripts(ie python library). So, I have considered
only taking the libraries I need. My question, is python license
friendly for doing
> [[]]*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? (
Devan L wrote:
> John Machin wrote:
>
>>Devan L wrote:
>>
>>>John Machin wrote:
>>>
>>>
Aahz wrote:
>In article <[EMAIL PROTECTED]>,
>John Machin <[EMAIL PROTECTED]> wrote:
>
>
>
>>Search for r'^something' can never be better/faster than match for
>>r'som
Gregory Bond <[EMAIL PROTECTED]> writes:
> phil hunt wrote:
>> Let q(x) be a property provable about objects x of type T. Then
>> q(y) should be true for objects y of type S where S is a subtype of T
>> To me, this is nonsense. Under this definition any subtype must
>> behave the same as its pa
John Machin wrote:
> Devan L wrote:
>
>> John Machin wrote:
>>
>>> Aahz wrote:
>>>
In article <[EMAIL PROTECTED]>,
John Machin <[EMAIL PROTECTED]> wrote:
> Search for r'^something' can never be better/faster than match for
> r'something', and with a dopey implementatio
John Machin wrote:
> Devan L wrote:
> > John Machin wrote:
> >
> >>Aahz wrote:
> >>
> >>>In article <[EMAIL PROTECTED]>,
> >>>John Machin <[EMAIL PROTECTED]> wrote:
> >>>
> >>>
> Search for r'^something' can never be better/faster than match for
> r'something', and with a dopey implementa
def debug(s):
print "s"
exec(s)
The line thing i'm not so sure about. Er. Hmmm.
On Thu, 2005-08-11 at 14:04 -0700, Rex Eastbourne wrote:
> Hi all,
>
> I've written the following simple macro called debug(aname, avalue)
> that prints out the name of an expression and its value:
>
Devan L wrote:
> John Machin wrote:
>
>>Aahz wrote:
>>
>>>In article <[EMAIL PROTECTED]>,
>>>John Machin <[EMAIL PROTECTED]> wrote:
>>>
>>>
Search for r'^something' can never be better/faster than match for
r'something', and with a dopey implementation of search [which Python's
re is
John Machin wrote:
> Aahz wrote:
> > In article <[EMAIL PROTECTED]>,
> > John Machin <[EMAIL PROTECTED]> wrote:
> >
> >>Search for r'^something' can never be better/faster than match for
> >>r'something', and with a dopey implementation of search [which Python's
> >>re is NOT] it could be much wor
John Machin a écrit :
> bruno modulix wrote:
>
(snip)
>>
>> Nope. But since you're running this on a very peculiar OS, I just can
>> guess that this very peculiar OS consider all args to be one same
>> string...
>
>
> NOT SO:
Your cap key got stuck ?
(snip)
> For *any* OS: More than one CLI
On Thu, 11 Aug 2005 14:55:57 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote:
>Bengt Richter wrote:
>> Will/should an __init__.py in the current directory be required,
>> to control what happens (and lessen the probability of accidental
>> collision from a random working directory)?
>
>I don't think
Paul Watson wrote:
> cantabile wrote:
>
>> Hi, being a newbie in Python, I'm a bit lost with the '-*- coding :
>> -*-' directive.
>>
>> I'm using an accented characters language. Some of them are correctly
>> displayed while one doesn't. I've written :
>> -*- coding: utf-8 -*-
>>
>> Is this wron
On 8/11/05, Jeremy Moles <[EMAIL PROTECTED]> wrote:
> Anyway, I am just curious... we plan on using it, at any rate. It's
> already made the code easier to read, faster, and more reliable.
Looks pretty useful to me!
--
# p.d.
--
http://mail.python.org/mailman/listinfo/python-list
bruno modulix wrote:
> Daniel Schüle wrote:
>
>>Hello
>>
>>I wrote a simple module, which is also supposed to be used as standalone
>>program
>>after considering how to avoid multiple if's I came up with this idea
>>
>>if __name__ == "__main__":
>>if len(sys.argv) not in (3,4):
>>prin
> You seem to be assuming that a yield statement and a function call are
> equivalent. I'm not sure that's a valid assumption.
I don't know. I was hoping the compiler can optimize away the chain of
yields.
> Anyway, here's some data to consider:
>
> test.py -
I think bs = BeautifulSoup.BeautifulSoup( oFile) but I don't understand what you are doing...
(I never used BeautifulSoup...)
Maybe It is somthing like:
import itertools
for incident in itertools.chain(bs('tr', {'bgcolor' : '#ee'}), bs('tr', {'bgcolor' : 'white'})):
do_something()
Look
On Thu, 11 Aug 2005 01:18:11 -0700, Matt Hammond
<[EMAIL PROTECTED]> wrote:
>
>> Is it an inherent issue in the use of recursive generator? Is there any
>> compiler optimization possible?
>
> Hi, I could be misunderstanding it myself, but I think the short answer
> to your question is that i
yaffa a écrit :
> dear python gurus,
One effectively needs to have some guru-powers to answer you question...
> quick question on syntax.
>
> i have a line of code like this
>
> for incident in bs('tr', {'bgcolor' : '#ee'}):
>
>
> what i want it to do is look
Where ?
> for 'bgcolor' :
John Machin wrote:
> jeff sacksteder wrote:
>> Regex questions seem to be rather resistant to googling.
>>
>> My regex currently looks like - 'FOO:.*\n\n'
>>
>> The chunk of text I am attempting to locate is a line beginning with
>> "FOO:", followed by an unknown number of lines, terminating wit
On 11 Aug 2005 11:56:49 -0700, "yaffa" <[EMAIL PROTECTED]> wrote:
>dear python gurus,
>
>quick question on syntax.
>
>i have a line of code like this
>
>for incident in bs('tr', {'bgcolor' : '#ee'}):
>
>
>what i want it to do is look for 'bgcolor' : '#ee' or 'bgcolor' :
>'white' and then
Michael Hoffman wrote:
> Srinivasan TK wrote:
>
>> Now ,Is it mandatory that I build the third-party
>> packages ( python2.4/site-packages) .
>
>
> Only if you want to use them. Really, no.
>
>> If so is there a
>> list that needs to be built and installed .
>
>
> There is a list of them pack
[EMAIL PROTECTED] wrote:
> On Thu, 11 Aug 2005 01:19:19 +0100
> phil hunt wrote:
>
> > According to Wikipedia, the Liskov substitution principle is:
> >
> > Let q(x) be a property provable about objects x of type T. Then
> > q(y) should be true for objects y of type S where S is a subtype of T
Hi all,
I've written the following simple macro called debug(aname, avalue)
that prints out the name of an expression and its value:
def debug(aname, avalue):
print aname, 'is':
pprint.pprint(avalue)
An example call is:
debug('compose(f1,f2)', compose(f1,f2))
Writing the exact same thi
I am mostly done with writing an extension module in C that wraps (and
makes easier) interfacing with libiw (the library that powers iwconfig,
iwlist, and friends on Linux). We're using this internally for a tool to
manage wireless connectivity. This is a million times better than
hundreds of invoc
yaffa a écrit :
> hey folks i get this error: Python interpreter error: unsupported
> operand type(s) for |:
>
> when i run this line of code:
>
> for incident in bs('tr', {'bgcolor' : '#ee'} | {'bgcolor' :
> 'white'} ):
>
> any idea what i'm doing wrong here?
yes: trying to do a bitwis
> "Matt" == Matt Feinstein <[EMAIL PROTECTED]> writes:
Matt> Hi all-- I'm planning to try to do a completely local
Matt> install of matplotlib (in Fedora Core 1)-- the system
Matt> administrator isn't going to stop me-- but he isn't going to
Matt> cooperate either. I've got the
Szabolcs Nagy a écrit :
> you cannot use | with two dict (dict has no .__or__ method)
>
> what are you trying to do?
>
read the post: "need help with python syntax"...
(posted one hour sooner)
--
http://mail.python.org/mailman/listinfo/python-list
Aahz wrote:
> In article <[EMAIL PROTECTED]>,
> John Machin <[EMAIL PROTECTED]> wrote:
>
>>Search for r'^something' can never be better/faster than match for
>>r'something', and with a dopey implementation of search [which Python's
>>re is NOT] it could be much worse. So please don't tell newbi
1 - 100 of 224 matches
Mail list logo