Re: Implementaion of random.shuffle

2007-07-16 Thread shabda raaj
On Jul 16, 8:29 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Hrvoje Niksic wrote: > > Steve Holden <[EMAIL PROTECTED]> writes: > > >> So it would appear that the developers chose the Knuth algorithm > >> (with a slight variation) for *their* implementation. Now you have > >> to ask yourself whethe

Re: Can a low-level programmer learn OOP?

2007-07-16 Thread Hendrik van Rooyen
"Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote: >My my my... Would you believe that my coworkers do consider me like an >old sage because I started programming in 1990 with HyperTalk on Mac >Classic !-) > >I suddenly feel 20 again ! Woo !-) *hands him a straw boater and a cane* ok youngster -

Re: Access Object From 2 Applications or Fix Scheduler

2007-07-16 Thread Hendrik van Rooyen
"Robert Rawlins - Think Blue" <[EMAIL PROTECTED]> top posted: >Also Hendrik, > >I should probably mention that the second application is a constant running >application, it's nothing something that can just be 'started' by the first >one, its running non-stop and just needs data passed into it re

Re: Best method for inter process communications

2007-07-16 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> wrote: > Given the radically inefficient representations that XML typically > requires, however, I think that worrying about localhost socket overhead > is unnecessary: if your application was *that* critical you wouldn't be > using XML in the first place. I

Re: In a dynamic language, why % operator asks user for type info?

2007-07-16 Thread Asun Friere
In practice the different placeholders give you a handle to achieve different formatting effects. Compare for example: for x in range(15) : print '%02d' % x against: for x in range(15) : print '%02s' % x #the '0' in this case being redundant Or again: from math import pi print '%.4f' %

Re: In a dynamic language, why % operator asks user for type info?

2007-07-16 Thread Paddy
On Jul 17, 1:10 am, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > Hi, > > The string format operator, %, provides a functionality similar to the > snprintf function in C. In C, the function does not know the type of > each of the argument and hence relies on the embedded % > specifier to guide itse

Re: sqlite3 db update extremely slow

2007-07-16 Thread Ben Finney
Steve Holden <[EMAIL PROTECTED]> writes: > # We try to ensure the database is always closed by registering > # the nodule's close() function to be called on program exit Ooh! Where do I find more about writing Python nodules? Is it related to cluster programming? -- \"If you go parachu

Re: getting text inside the HTML tag

2007-07-16 Thread BMintern
On Jul 14, 2:01 pm, [EMAIL PROTECTED] wrote: > Oi! Try Beautiful Soup instead. That seems to be the defacto HTML > parser for Python: > > http://www.crummy.com/software/BeautifulSoup/ After reading the docs through a bit and working through my own examples, I can see why. Thanks for the link! Bra

Programming Jokes

2007-07-16 Thread Jokeslide
Muahahaha http://www.jokeslide.com/index.php?cmd=4&project_id=78&obby_id=242 -- http://mail.python.org/mailman/listinfo/python-list

Is it possible to run two "while 1:" loops in two threadings respectively?

2007-07-16 Thread zxo102
Hi, I would like to combine two python applications into a single one with two threadings. Both of them have a "while 1:" loop respectively. For example, one application is to monitoring serial port 'com1' and another application is a TCP/IP server which has used threadings already. I write the

Re: Implementaion of random.shuffle

2007-07-16 Thread Martin v. Löwis
>> 2**19937 being a really huge number, it's impossible to exhaust the >> Mersenne twister by running it in sequence. > > "Impossible"? Unfeasible. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: In a dynamic language, why % operator asks user for type info?

2007-07-16 Thread Kay Schluehr
On Jul 17, 3:10 am, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > output = '%d foo %d bar" % (foo_count, bar_count), > why we need to use %d? I'm thinking some general common placeholder, > say %x (currently it's hex..) could be used. You already answered it in the parenthesized remark: the %d pl

Re: Fetching a clean copy of a changing web page

2007-07-16 Thread Carsten Haese
On Tue, 2007-07-17 at 00:47 +, John Nagle wrote: > Miles wrote: > > On Jul 16, 1:00 am, John Nagle <[EMAIL PROTECTED]> wrote: > > > >>I'm reading the PhishTank XML file of active phishing sites, > >>at "http://data.phishtank.com/data/online-valid/"; This changes > >>frequently, and it's b

Re: Accessing Python variables in an extension module

2007-07-16 Thread Alex Martelli
MD <[EMAIL PROTECTED]> wrote: > Hi Alex, > Thanks for the answer. Are there any C defines (for e.g. STRING, > BOOLEAN) corresponding to each Python type? No, I know of no such "defines" -- what good would they do? Alex -- http://mail.python.org/mailman/listinfo/python-list

RE: testing with coverage.py problem

2007-07-16 Thread Ryan Ginstrom
> On Behalf Of Piotr Hrebieniuk > I've spent few hours and found nothing, so here's my question: > How can i run tests wrote by myself on a module, using coverage.py ? > Let's assume i have a module mymod.py which i want to test > with tests from file mytest.py (i.e. class inherited from > unitte

how to compile python to have gtk and Tkinter modules in Linux environment.

2007-07-16 Thread cfpete
Hello, How do I go about to have python compiled from source so that I can import gtk and Tkinter modules. Those don't seem to be included when I use the default ./configure or python setup.py. Thanks in advance, -Peter -- http://mail.python.org/mailman/listinfo/python-list

how to compile python to have gtk and Tkinter modules in Linux environment.

2007-07-16 Thread cfpete
Hello, How do I go about to have python compiled from source so that I can import gtk and Tkinter modules. Those don't seem to be included when I use the default ./configure or python setup.py. Thanks in advance, -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Implementaion of random.shuffle

2007-07-16 Thread Steven D'Aprano
On Mon, 16 Jul 2007 14:45:48 +, shabda raaj wrote: > On Jul 16, 5:53 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> shabda raaj wrote: >> > I was going through the docs for module-random >> > And I came through >> > this, >> >> > * shuffle*(

Re: Implementaion of random.shuffle

2007-07-16 Thread Steven D'Aprano
On Mon, 16 Jul 2007 16:55:53 +0200, Hrvoje Niksic wrote: > 2**19937 being a really huge number, it's impossible to exhaust the > Mersenne twister by running it in sequence. "Impossible"? Surely this will do it: for n in xrange(2**19937 + 1): random.random() Admittedly, if each call to rand

Re: Implementaion of random.shuffle

2007-07-16 Thread Scott David Daniels
shabda raaj wrote: > ... Oh, I wasn't aware that I could see the source of all python modules Well, actually not _all_ (or is that __all__), but that is exactly why so many of us love Python -- no magic (or at least as little as needed). --Scott David Daniels [EMAIL PROTECTED] -- http://mail

Re: In a dynamic language, why % operator asks user for type info?

2007-07-16 Thread Miles
On Jul 16, 8:10 pm, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > Since % by definition is string formatting, the operator should be > able to infer how to convert each of the argument into strings. In addition to what Dan mentioned, you can use "%s" with any object to perform an automatic string

Re: how to find available classes in a file ?

2007-07-16 Thread Gabriel Genellina
En Mon, 16 Jul 2007 20:13:19 -0300, Alex Popescu <[EMAIL PROTECTED]> escribió: > On Jul 17, 1:44 am, Stef Mientki <[EMAIL PROTECTED]> > wrote: >> I want to have a (dynamically) list of all classes defined in a py-file. >> Is there a way of getting this list, without manually parsing the file ? >

ANN: Tftpy 0.4.3

2007-07-16 Thread msoulier
Copyright, Michael P. Soulier, 2006. About Release 0.4.3: Buxfix release for an issue with the server's detection of the end of the file during a download. About Release 0.4.2: Bugfix release for some small installation issues with earlier Python releases

Re: sqlite3 db update extremely slow

2007-07-16 Thread Steve Holden
coldpizza wrote: > Thanks a lot, Roel, adding a single commit() at the end did solve the > speed problem. > > Another question is do I have to explicitly close the DB connection, > or is it automatically garbage collected? Is it Ok to no have any > cleanup code? > It's generally OK, but you can r

Re: Fetching a clean copy of a changing web page

2007-07-16 Thread Steve Holden
John Nagle wrote: > Miles wrote: >> On Jul 16, 1:00 am, John Nagle <[EMAIL PROTECTED]> wrote: >> >>>I'm reading the PhishTank XML file of active phishing sites, >>> at "http://data.phishtank.com/data/online-valid/"; This changes >>> frequently, and it's big (about 10MB right now) and on a busy

Re: 2**2**2**2**2 wrong? Bug?

2007-07-16 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Jul 15, 4:37 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> Wayne Brehaut wrote: >>> On Fri, 13 Jul 2007 14:32:03 -0700, "[EMAIL PROTECTED]" >> [...] >>> But I digress (but only because provoked!)... > [for purposes of this argument, at least] >>> This statement is

Re: In a dynamic language, why % operator asks user for type info?

2007-07-16 Thread marduk
On Mon, 2007-07-16 at 17:33 -0700, Karthik Gurusamy wrote: > Thanks. The above surprised me as I didn't expect that %s will accept > 42. > > Looks like the implicit conversion doesn't work the other way. > > >>> '%s' % 42 > '42' > >>> '%d' % '42' > Traceback (most recent call last): > File "",

Re: Fetching a clean copy of a changing web page

2007-07-16 Thread John Nagle
Miles wrote: > On Jul 16, 1:00 am, John Nagle <[EMAIL PROTECTED]> wrote: > >>I'm reading the PhishTank XML file of active phishing sites, >>at "http://data.phishtank.com/data/online-valid/"; This changes >>frequently, and it's big (about 10MB right now) and on a busy server. >>So once in a wh

Re: In a dynamic language, why % operator asks user for type info?

2007-07-16 Thread Karthik Gurusamy
On Jul 16, 5:18 pm, Dan Bishop <[EMAIL PROTECTED]> wrote: > On Jul 16, 7:10 pm, Karthik Gurusamy <[EMAIL PROTECTED]> wrote:> Hi, > > > The string format operator, %, provides a functionality similar to the > > snprintf function in C. In C, the function does not know the type of > > each of the argu

Re: In a dynamic language, why % operator asks user for type info?

2007-07-16 Thread Matimus
I don't have a good answer for you, but you might be interested to read this: http://python.org/dev/peps/pep-3101/. Which according to a recent blog post by BDFL is going to be how string formatting is done in Python3000. The character doesn't specify the type to expect, but the formatting functio

Re: In a dynamic language, why % operator asks user for type info?

2007-07-16 Thread [EMAIL PROTECTED]
On Jul 16, 7:10 pm, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > Hi, > > The string format operator, %, provides a functionality similar to the > snprintf function in C. In C, the function does not know the type of > each of the argument and hence relies on the embedded % > specifier to guide itse

Re: In a dynamic language, why % operator asks user for type info?

2007-07-16 Thread Dan Bishop
On Jul 16, 7:10 pm, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > Hi, > > The string format operator, %, provides a functionality similar to the > snprintf function in C. In C, the function does not know the type of > each of the argument and hence relies on the embedded % > specifier to guide itse

Re: Semantics of file.close()

2007-07-16 Thread Matimus
> How do I ensure that the close() methods in my finally clause do not > throw an exception? You have no choice. If close is going to fail, it will fail. Fortunately you can catch the exception and continue on. try: try: file1.write(somestuff) finally: file1.close() except

In a dynamic language, why % operator asks user for type info?

2007-07-16 Thread Karthik Gurusamy
Hi, The string format operator, %, provides a functionality similar to the snprintf function in C. In C, the function does not know the type of each of the argument and hence relies on the embedded % specifier to guide itself while retrieving args. In python, the language already provides ways to

Re: Semantics of file.close()

2007-07-16 Thread Dan Bishop
On Jul 16, 6:35 pm, [EMAIL PROTECTED] wrote: > Hello, > > I'm a Python beginner and I'm trying to open, write and close a file > in a > correct manner. I've RTFM, RTFS, and I've read this > thread:http://groups.google.ca/group/comp.lang.python/browse_thread/thread/7... > > I still cannot figure ou

Re: Binary blobs to jpeg

2007-07-16 Thread jayharvard
On Jul 16, 3:23 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-07-16, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > >> Have you tried to open the file in "wb" mode? > > > The data is coming from a record set selection from the Access > > database. I guess I could write the data to a temp

Re: trouble controlling vim with subprocess on windows machine

2007-07-16 Thread [EMAIL PROTECTED]
On Jul 16, 7:45 am, Yves Pouplard <[EMAIL PROTECTED]> wrote: > On Mon, 09 Jul 2007 05:30:04 -0500, Nick Craig-Wood > > <[EMAIL PROTECTED]> wrote: > >[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >> I am having trouble contolling vim with subprocess on a windows > >> machine. It appears tha

Re: Semantics of file.close()

2007-07-16 Thread seerdecker
Sorry for the bad formatting; I've had to post this through the google groups. -- http://mail.python.org/mailman/listinfo/python-list

Semantics of file.close()

2007-07-16 Thread seerdecker
Hello, I'm a Python beginner and I'm trying to open, write and close a file in a correct manner. I've RTFM, RTFS, and I've read this thread: http://groups.google.ca/group/comp.lang.python/browse_thread/thread/73bbda2c920521c/98c731229d86b01d?lnk=st&q=python+file+explicit+close&rnum=1&hl=en#98c7312

Re: The ** operator ambiguous?

2007-07-16 Thread Paul Boddie
Robert Dailey wrote: > I noticed that the ** operator is used as the power operator, however > I've seen it used when passing variables into a function. Others have already pointed out the relevant documentation. However, this ambiguous usage of * and ** is one thing I don't recall appearing on an

[Music Movies Soft] Free binaries search & download = www.GEGEREKA.com

2007-07-16 Thread GEGEREKA!
Project of the year: Incredible unique search machine like nothing on earth. MP3,MPEG,AVI,DIVX,DLL,PHP,EXE,ISO, ...and much more Millions files for everyone. Music, movies, soft and other media. http://www.GEGEREKA.com : THE LORD OF DOWNLOADS. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to organize control access to source code ?

2007-07-16 Thread Succelus
On 16 juil, 21:10, Erik Jones <[EMAIL PROTECTED]> wrote: > On Jul 16, 2007, at 3:46 PM, [EMAIL PROTECTED] wrote: > > > Hello, > > How can we organize development team with code source control policy, > > that limit access to some portion of code ? > > The specifics largely depend on the system(s) y

Re: how to find available classes in a file ?

2007-07-16 Thread Alex Popescu
On Jul 17, 1:44 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > I want to have a (dynamically) list of all classes defined in a py-file. > Is there a way of getting this list, without manually parsing the file ? > > thanks, > Stef Mientki I have written something that does something like this, but I

Re: sqlite3 db update extremely slow

2007-07-16 Thread coldpizza
Thanks a lot, Roel, adding a single commit() at the end did solve the speed problem. Another question is do I have to explicitly close the DB connection, or is it automatically garbage collected? Is it Ok to no have any cleanup code? Another question would be how to define the encoding for newly

Re: 2**2**2**2**2 wrong? Bug?

2007-07-16 Thread [EMAIL PROTECTED]
On Jul 15, 4:37 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Wayne Brehaut wrote: > > On Fri, 13 Jul 2007 14:32:03 -0700, "[EMAIL PROTECTED]" > [...] > > But I digress (but only because provoked!)... > > >>> [for purposes of this argument, at least] > > > This statement is the informal equivalent

Re: 2**2**2**2**2 wrong? Bug?

2007-07-16 Thread [EMAIL PROTECTED]
On Jul 15, 4:28 pm, Wayne Brehaut <[EMAIL PROTECTED]> wrote: > On Fri, 13 Jul 2007 14:32:03 -0700, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> wrote: > >On Jul 13, 2:52 pm, Wayne Brehaut <[EMAIL PROTECTED]> wrote: > >> On Fri, 13 Jul 2007 11:30:16 -0700, Paul McGuire <[EMAIL PROTECTED]> > >> wrote: >

Re: Break up list into groups

2007-07-16 Thread James Stroud
Paul Rubin wrote: > See: > > http://groups.google.com/group/comp.lang.python/msg/2410c95c7f3b3654 Groupby is damn slow as far as I can tell (the Bates numbering in the above link assumes more than the OP intended, I assume). It looks like the author's original algorithm is the fastest python wa

Re: Break up list into groups

2007-07-16 Thread [EMAIL PROTECTED]
> Here's an ugly way I wouldn't recommended (using itertools groupby): > > py> from itertools import groupby > py> alist = [0xF0, 1, 2, 3, 0xF0, 4, 5, 6, > ... 0xF1, 7, 8, 0xF2, 9, 10, 11, 12, 13, > ... 0xF0, 14, 0xF1, 15] > py> def doit(alist): > ... i = (list(g) for k,g in gro

Re: Break up list into groups

2007-07-16 Thread [EMAIL PROTECTED]
On Jul 16, 3:56 pm, marduk <[EMAIL PROTECTED]> wrote: > On Mon, 2007-07-16 at 16:31 -0500, marduk wrote: > > Assuming you meant '0xF0' instead of '0x80' do you mean any value > > >=240 starts a new group? If so: No, I meant 0x80. 0x80 is only the most significant bit of the 0xF0 value. Every t

how to find available classes in a file ?

2007-07-16 Thread Stef Mientki
I want to have a (dynamically) list of all classes defined in a py-file. Is there a way of getting this list, without manually parsing the file ? thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Break up list into groups

2007-07-16 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I can't seem to find an answer to this question anywhere, but I'm > still looking. My problem is I have a list of values like this: > > l = [0xF0, 1, 2, 3, 0xF0, 4, 5, 6, 0xF1, 7, 8, 0xF2, 9, 10, 11, 12, > 13, 0xF0, 14, 0xF1, 15] > > A value with

www.cerocom.com

2007-07-16 Thread Natalia
.. www.cerocom.com .. You will be able to ask yourself: Is Internet a good investment for my company? So that an investment would have to do I of this type? Really is going to serve to me to have a Web site? So that to be in

www.cerocom.com

2007-07-16 Thread Natalia
.. www.cerocom.com .. You will be able to ask yourself: Is Internet a good investment for my company? So that an investment would have to do I of this type? Really is going to serve to me to have a Web site? So that to be in

Re: zipfile 2GB problems?

2007-07-16 Thread John Machin
On Jul 17, 7:37 am, xamdam <[EMAIL PROTECTED]> wrote: > On Jul 16, 3:39 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > > > > xamdam wrote: > > > On Jul 15, 5:39 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > >> xamdam wrote: > > > Additional info: my file is from a data provider, do not know

Re: The ** operator ambiguous?

2007-07-16 Thread Klaas
On Jul 16, 10:40 am, Robert Dailey <[EMAIL PROTECTED]> wrote: > I noticed that the ** operator is used as the power operator, however > I've seen it used when passing variables into a function. For example, > I was researching a way to combine dictionaries. I found that if you > do this: > > a = {"

Re: Break up list into groups

2007-07-16 Thread Matimus
This is a perfect place for a generator: seq = [0xF0, 1, 2, 3, 0xF0, 4, 5, 6, 0xF1, 7, 8, 0xF2, 9, 10, 11, 12, 13, 0xF0, 14, 0xF1, 15] def gengroups(seq): group = [] for val in seq: if val & 0x80 and group: yield group group = [] group.append(val)

Re: Break up list into groups

2007-07-16 Thread James Stroud
James Stroud wrote: > Here's how I *would* do it: > > py> def doit(alist): > ... ary = [] > ... for i in alist: > ... if 0xf0 & i: > ... ary.append([i]) > ... else: > ... ary[-1].append(i) > ... return [x for x in ary if x] > ... To be absolutely compliant with the spec

Re: zipfile 2GB problems?

2007-07-16 Thread John Machin
On Jul 17, 4:59 am, xamdam <[EMAIL PROTECTED]> wrote: > On Jul 15, 5:39 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > > > > xamdam wrote: > > >>> Additional info: my file is from a data provider, do not know what > > >>> they used to compress it. Previous files worked ok, this one is the > > >>>

Re: Break up list into groups

2007-07-16 Thread James Stroud
[EMAIL PROTECTED] wrote: > All, > > I can't seem to find an answer to this question anywhere, but I'm > still looking. My problem is I have a list of values like this: > > l = [0xF0, 1, 2, 3, 0xF0, 4, 5, 6, 0xF1, 7, 8, 0xF2, 9, 10, 11, 12, > 13, 0xF0, 14, 0xF1, 15] > > A value with bit 0x80 set

Re: Python-URL! - weekly Python news and links (Jul 16)

2007-07-16 Thread Kay Schluehr
Gabriel Genellina schrieb: > QOTW: "That's a property of open source projects. Features nobody really > needs are not implemented." - Gregor Horvath It's a good QOTW but social romantic nonsense nevertheless. Not sure if it's important enough to be mentioned in weekly Python news but Europython

[Music Movies Soft] Free binaries search & download = www.GEGEREKA.com

2007-07-16 Thread GEGEREKA!
Project of the year: Incredible unique search machine like nothing on earth. MP3,MPEG,AVI,DIVX,DLL,PHP,EXE,ISO, ...and much more Millions files for everyone. Music, movies, soft and other media. http://www.GEGEREKA.com : THE LORD OF DOWNLOADS. -- http://mail.python.org/mailman/listinfo/python-list

Re: Break up list into groups

2007-07-16 Thread marduk
On Mon, 2007-07-16 at 16:31 -0500, marduk wrote: > Assuming you meant '0xF0' instead of '0x80' do you mean any value > >=240 starts a new group? If so: > > groups = [] > current = [] # probably not necessary, but as a safety > for i in l: > if i >= 240: > current = [] > gr

Re: Class decorators do not inherit properly

2007-07-16 Thread Bruno Desthuilliers
Lee Harr a écrit : >>>I think the term "class decorator" is going to eventually >>>mean something other than what you are doing here. I'd >>>avoid the term for now. >>> >>> >>>When you decorate a class method, >>>the function you use >>>needs to be defined before the method definition. >> >>FWIW, t

Re: zipfile 2GB problems?

2007-07-16 Thread xamdam
On Jul 16, 3:39 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > xamdam wrote: > > On Jul 15, 5:39 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > >> xamdam wrote: > > Additional info: my file is from a data provider, do not know what > > they used to compress it. Previous files worked ok, this

Re: questions about functions inside a function

2007-07-16 Thread Bruno Desthuilliers
Jeremy Sanders a écrit : > [EMAIL PROTECTED] wrote: > > >>What I want is, the value of i should be bounded to the anonymous >>function. And the output should like this: > > ... > >>How to achieve this? > > > This doesn't answer your question (others have), but another (perhaps > clearer) way

Re: Discover instance variables

2007-07-16 Thread Lawrence Oluyede
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > The list keeps only the types explicitely enumerated. Other types are > excluded, as well as names starting with "_". Another criterion would be > `not attr.startswith('_') and not callable(getattr(obj,attr))` Why not: In [1]: class Foo(object): .

Re: Break up list into groups

2007-07-16 Thread marduk
On Mon, 2007-07-16 at 14:11 -0700, [EMAIL PROTECTED] wrote: > I can't seem to find an answer to this question anywhere, but I'm > still looking. My problem is I have a list of values like this: > > l = [0xF0, 1, 2, 3, 0xF0, 4, 5, 6, 0xF1, 7, 8, 0xF2, 9, 10, 11, 12, > 13, 0xF0, 14, 0xF1, 15] > > A

Re: Private functions and inheritance

2007-07-16 Thread Bruno Desthuilliers
Maciej Bliziński a écrit : (snip the rest - already answered by at least 3 persons). > I > don't want to expose the __bar() function outside, but on the other > hand i want to defer its implementation to a subclass. It seems like I > need to make it public, doesn't it? First, keep in mind that th

Re: Dynamic method

2007-07-16 Thread Daniel
Bruno Desthuilliers wrote: > > > Another way is to use the 'types' module: > > True - and that's somewhat cleaner since it doesn't expose the internals > of the descriptor protocol. OTHO, it can lead to strange results with > callables not implementing the descriptor protocol: Actually, the resu

Re: Technology solutions for Ruby?

2007-07-16 Thread Bruno Desthuilliers
vasudevram a écrit : (snip) >>To me this means Ruby, Python, or, as mentioned above, Perl. If anyone > > can tell me of a way to meet the above requirements in either Python > or > Perl, I'm all ears (I just prefer Ruby). >>1. GUI - Native Look and Feel. According to wxRuby the bindings aren't

Break up list into groups

2007-07-16 Thread [EMAIL PROTECTED]
All, I can't seem to find an answer to this question anywhere, but I'm still looking. My problem is I have a list of values like this: l = [0xF0, 1, 2, 3, 0xF0, 4, 5, 6, 0xF1, 7, 8, 0xF2, 9, 10, 11, 12, 13, 0xF0, 14, 0xF1, 15] A value with bit 0x80 set delineates the start of a new packet of inf

Re: How to organize control access to source code ?

2007-07-16 Thread Erik Jones
On Jul 16, 2007, at 3:46 PM, [EMAIL PROTECTED] wrote: > Hello, > How can we organize development team with code source control policy, > that limit access to some portion of code ? The specifics largely depend on the system(s) you're working with but, basically (sic), you need to read up on fil

How to organize control access to source code ?

2007-07-16 Thread Succelus
Hello, How can we organize development team with code source control policy, that limit access to some portion of code ? Sincerely, Ahmed Boukhari -- http://mail.python.org/mailman/listinfo/python-list

Re: Discover instance variables

2007-07-16 Thread JonathanB
> > class Foo(): > > self.a = "bar" > > self.z = "test" > > self.var = 2 > > That's unlikely to work, though: the code is in the context of the > class, not one of its methods, so unless you happen to be declaring a > class inside another class's method it's unlikely that there's going

Re: sqlite3 db update extremely slow

2007-07-16 Thread Roel Schroeven
coldpizza schreef: > I am trying to fill a sqlite3 database with records, and to this end I > have written a class that creates the db, the table and adds rows to > the table. > > The problem is that the updating process is *extremely* slow, and > occasionally I get the message "database locked".

Re: Can a low-level programmer learn OOP?

2007-07-16 Thread Bruno Desthuilliers
Wayne Brehaut a écrit : > On Sat, 14 Jul 2007 19:18:05 +0530, "Rustom Mody" > <[EMAIL PROTECTED]> wrote: > > >>On 7/14/07, Alex Martelli <[EMAIL PROTECTED]> wrote: >> >>>OOP can be abused (particularly with deep or intricate inheritance >>>structures). But the base concept is simple and clear: y

Re: Technology solutions for Ruby?

2007-07-16 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: . . . >wxPython uses the native widgets of the platform it is running on in >most (if not all) cases, so if you want the "native look & feel", than >that is the way I

Re: Can a low-level programmer learn OOP?

2007-07-16 Thread Bruno Desthuilliers
Wayne Brehaut a écrit : > On Fri, 13 Jul 2007 20:37:04 -0400, Steve Holden <[EMAIL PROTECTED]> > wrote: > > >>Aahz wrote: >> >>>In article <[EMAIL PROTECTED]>, >>>Chris Carlen <[EMAIL PROTECTED]> wrote: From what I've read of OOP, I don't get it. >>> >>>For that matter, even using OOP a bi

[OT] Re: Can a low-level programmer learn OOP?

2007-07-16 Thread Bruno Desthuilliers
Wayne Brehaut a écrit : > On Mon, 16 Jul 2007 10:10:05 +0200, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > > >>Wayne Brehaut a écrit : >>(snip) >> >>>after Bruno made the >>>claim: "OO is about machines - at least as conceveid by Alan Key, who >>>invented the term and most of the concept."

Re: running a Delphi part from Python ?

2007-07-16 Thread Chris Mellon
On 7/16/07, Stef Mientki <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > > Delphi components are tightly tied to the Delphi runtime environment > > and its' gui abstractions, so embedding it as is is will be a massive > > hack (and require extensive C code) if its even possible. > The editor I'v

Re: Best method for inter process communications

2007-07-16 Thread JamesHoward
Thanks for the updates. I think I will try named processes first, but may just end up using local sockets in the end and not worry about the overhead. Jim Howard -- http://mail.python.org/mailman/listinfo/python-list

Re: zipfile 2GB problems?

2007-07-16 Thread Steve Holden
xamdam wrote: > On Jul 15, 5:39 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> xamdam wrote: > Additional info: my file is from a data provider, do not know what > they used to compress it. Previous files worked ok, this one is the > 1st over 2GB. Winzip has no problem with it. It

Re: Can a low-level programmer learn OOP?

2007-07-16 Thread Steve Holden
Chris Carlen wrote: > Hendrik van Rooyen wrote: >> "Chris Carlen" wrote: >>> Form 2: Use Python and PySerial and TkInter or wxWidgets. >>> Pro: Cross-platform goal will likely be achieved fully. Have a >>> programmer nearby with extensive experience who can help. >>> Con: Must learn new lang

Re: urllib to cache 301 redirections?

2007-07-16 Thread John Nagle
O.R.Senthil Kumaran wrote: > Thank you for the reply, Mr. John and I apologize for a very late response > from my end. > > * John J. Lee <[EMAIL PROTECTED]> [2007-07-06 18:53:09]: > > >>"O.R.Senthil Kumaran" <[EMAIL PROTECTED]> writes: >> >> >>>Hi, >>>There is an Open Tracker item against urllib

Re: Binary blobs to jpeg

2007-07-16 Thread Grant Edwards
On 2007-07-16, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> Have you tried to open the file in "wb" mode? > > The data is coming from a record set selection from the Access > database. I guess I could write the data to a temp file and > open that file handle with the "wb" mode. But, no, I haven

sqlite3 db update extremely slow

2007-07-16 Thread coldpizza
I am trying to fill a sqlite3 database with records, and to this end I have written a class that creates the db, the table and adds rows to the table. The problem is that the updating process is *extremely* slow, and occasionally I get the message "database locked". I tried removing "self.con.com

Re: running a Delphi part from Python ?

2007-07-16 Thread Stef Mientki
> > Of course You can always write one, that's succicient for Your needs, > and make it available under GPL. ;-) Why not BSD ? But I've to read all the licenses of the used components first ;-) cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Best method for inter process communications

2007-07-16 Thread John Nagle
Steve Holden wrote: > JamesHoward wrote: > Given the radically inefficient representations that XML typically > requires, however, I think that worrying about localhost socket overhead > is unnecessary: if your application was *that* critical you wouldn't be > using XML in the first place.

Re: running a Delphi part from Python ?

2007-07-16 Thread Stef Mientki
Chris Mellon wrote: > On 7/16/07, Stef Mientki <[EMAIL PROTECTED]> wrote: >> tool69 wrote: >> > Stef Mientki a écrit : >> > >> >> AFAIK, Scintilla is a code editor. >> >> What I need looks more like ms-word, >> >> handling lists, tables, images, formulas. >> >> >> >> thanks, >> >> Stef Mientki >> >

Re: urllib to cache 301 redirections?

2007-07-16 Thread John J Lee
On Tue, 17 Jul 2007, O.R.Senthil Kumaran wrote: [...] > I spent a little time thinking about a solution and figured out that the > following changes to HTTPRedirectHandler, might be helpful in implementing > this. [...] Did you post it on the Python SF patch tracker? If not, please do, and point

Re: Accessing Python variables in an extension module

2007-07-16 Thread Hrvoje Niksic
MD <[EMAIL PROTECTED]> writes: > 2) Is there anyway to find the type of the object in C using something > like a switch statement? I was looking for something like this >switch type(object) { > STRING: "This is a string object"; > break; > INTEGER: "This is an integer

Re: Binary blobs to jpeg

2007-07-16 Thread jayharvard1
> Have you tried to open the file in "wb" mode? > > HTH, > > -- > Carsten Haesehttp://informixdb.sourceforge.net The data is coming from a record set selection from the Access database. I guess I could write the data to a temp file and open that file handle with the "wb" mode. But, no, I haven't t

Re: Binary blobs to jpeg

2007-07-16 Thread Carsten Haese
On Mon, 2007-07-16 at 18:57 +, [EMAIL PROTECTED] wrote: > Hello All. > I'm trying to create jpegs out of data that is stored in a binary blob > format in an RDBMS (MS Access). I've tried writing the jpeg directly: > > while not rs.EOF: > op = file(imgdir + "\\" + pic,"w") > print >>

Bug with make altinstall ?

2007-07-16 Thread bravo . loic
I've made a local installation of Python2.5 with the following instruction : export BASE=/usr/local/python251 cd Python.2.5.1 ./configure --prefix=${BASE}/\ LDFLAGS="-L\${BASE}/lib/"\ PPFLAGS="-I\${BASE}/include/"\ make make test make altinstall It works fine on Linux except this little

testing with coverage.py problem

2007-07-16 Thread Piotr Hrebieniuk
Hi there. I've spent few hours and found nothing, so here's my question: How can i run tests wrote by myself on a module, using coverage.py ? Let's assume i have a module mymod.py which i want to test with tests from file mytest.py (i.e. class inherited from unittest.TestCase). How to do that with

Re: zipfile 2GB problems?

2007-07-16 Thread xamdam
On Jul 15, 5:39 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > xamdam wrote: > >>> Additional info: my file is from a data provider, do not know what > >>> they used to compress it. Previous files worked ok, this one is the > >>> 1st over 2GB. Winzip has no problem with it. > >> It could be you are

Binary blobs to jpeg

2007-07-16 Thread jayharvard1
Hello All. I'm trying to create jpegs out of data that is stored in a binary blob format in an RDBMS (MS Access). I've tried writing the jpeg directly: while not rs.EOF: op = file(imgdir + "\\" + pic,"w") print >> op, rs.Fields[3].Value ##where rs.Fields[3].Value is the data in the

Re: urllib to cache 301 redirections?

2007-07-16 Thread O.R.Senthil Kumaran
Thank you for the reply, Mr. John and I apologize for a very late response from my end. * John J. Lee <[EMAIL PROTECTED]> [2007-07-06 18:53:09]: > "O.R.Senthil Kumaran" <[EMAIL PROTECTED]> writes: > > > Hi, > > There is an Open Tracker item against urllib2 library python.org/sf/735515 > > > I a

Re: Technology solutions for Ruby?

2007-07-16 Thread kyosohma
On Jul 16, 1:46 pm, vasudevram <[EMAIL PROTECTED]> wrote: > On Jul 16, 10:25 pm, vasudevram <[EMAIL PROTECTED]> wrote: > > > > > [ Though the OP posted his message to comp.lang.ruby, I'm cross- > > posting it to comp.lang.python, since he mentions Python as a possible > > alternative he's looking a

Re: Technology solutions for Ruby?

2007-07-16 Thread vasudevram
On Jul 16, 10:25 pm, vasudevram <[EMAIL PROTECTED]> wrote: > [ Though the OP posted his message to comp.lang.ruby, I'm cross- > posting it to comp.lang.python, since he mentions Python as a possible > alternative he's looking at, and also because I've recommended Python > for his stated needs. Also

  1   2   >