Re: Python "implements " equivalent?

2007-10-04 Thread Bruno Desthuilliers
Grant Edwards a écrit : > On 2007-10-04, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > >>Yes, and it's even simpler : just pass your object. If it effectively >>implements the desired interface, everything will work fine !-) > > [...] > > >>>What I'd like to do is create a feature detect

Re: RegEx question

2007-10-04 Thread Manu Hack
On 10/4/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > On 10/4/07, Adam Lanier <[EMAIL PROTECTED]> wrote: > > > > try @param\[(in|out)\] \w+ > > > > This didn't work either :( > > The tool using this regular expression (Comment Reflower for VS2005) May be > broken... > > -- > http://mail.python.org

Re: unit testing

2007-10-04 Thread Paul Rubin
brad <[EMAIL PROTECTED]> writes: > Does anyone else feel that unittesting is too much work? Not in > general, just the official unittest module for small to medium sized > projects? Yeah, unittest is sort of a Java-ism. You might try the newer doctest module instead. -- http://mail.python.org/ma

Boolean parser..

2007-10-04 Thread Abandoned
Hi.. I try a boolean parser in python since 1 weak.. But i can't do this because this is very complicated :( Do you know any blooean parser script in python or how do i write a boolean parser ? example query: ((google or yahoo) or (live msn)) not web I'm sorry my bad english. King Regards.. -- ht

Owner of spawned process in threads

2007-10-04 Thread Vishal Sethia
Just trying to understand the behaviour of spawn. Consider I have a function which creates two threads. And in one of the threads I make a call to pexpect.spawn. spawn would fork and create a new new child In this case who becomes the owner of this child process. Is it the thread that spawned beco

Re: unit testing

2007-10-04 Thread [EMAIL PROTECTED]
On Oct 4, 1:02 pm, brad <[EMAIL PROTECTED]> wrote: > Does anyone else feel that unittesting is too much work? Not in general, > just the official unittest module for small to medium sized projects? > > It seems easier to write some quick methods that are used when needed > rather than building a pr

TwistedMatrix missing OpenSSL?

2007-10-04 Thread Lamonte Harris
Where do I get it? I'm currently running python 2.5 -- http://mail.python.org/mailman/listinfo/python-list

Re: RegEx question

2007-10-04 Thread Tim Chase
[sigh...replying to my own post] > However, things to try: > > - sometimes the grouping parens need to be escaped with "\" > > - sometimes "\w" isn't a valid character class, so use the > long-hand variant of something like "[a-zA-Z0-9_]] > > - sometimes the "+" is escaped with a "\" > > - if

Re: Boolean parser..

2007-10-04 Thread timaranz
On Oct 5, 7:29 am, Abandoned <[EMAIL PROTECTED]> wrote: > Hi.. > I try a boolean parser in python since 1 weak.. But i can't do this > because this is very complicated :( > Do you know any blooean parser script in python or how do i write a > boolean parser ? > example query: ((google or yahoo) or

Re: HELP me Am very new one To python

2007-10-04 Thread Bruno Desthuilliers
Damodhar a écrit : > hi, > > Am working in PHP MYSQL. I am very very interest to learn Python but i > don't Know Little Bit, > am using windows Xp, Ialready download from > http://www.python.org/ftp/python/2.5.1/python-2.5.1.ia64.msi > > and install into C:\Python25 > > whats the next step . i U

Re: unit testing

2007-10-04 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > On Oct 4, 1:02 pm, brad <[EMAIL PROTECTED]> wrote: >> Does anyone else feel that unittesting is too much work? Not in general, >> just the official unittest module for small to medium sized projects? [snip] > I actually do a lot of unit testing. I find it both annoying a

Re: RegEx question

2007-10-04 Thread Robert Dailey
I am not a regex expert, I simply assumed regex was standardized to follow specific guidelines. I also made the assumption that this was a good place to pose the question since regular expressions are a feature of Python. The question concerned regular expressions in general, not really the applica

Re: List of objects X Database

2007-10-04 Thread Gerardo Herzig
MindMaster32 wrote: >I am writing a script that has to read data from an ASCII file of >about 50 Mb and do a lot of searches and calculations with that data. >That would be a classic problem solved by the use of a database >(SQLite would suit just fine), but that would require the user to >install

Re: RegEx question

2007-10-04 Thread Tim Chase
>>> try @param\[(in|out)\] \w+ >>> >> This didn't work either :( >> >> The tool using this regular expression (Comment Reflower for VS2005) May be >> broken... > > How about @param\[[i|o][n|u]t*\]\w+ ? ...if you want to accept patterns like @param[iutt]xxx ... The regexp at the top

Re: unit testing

2007-10-04 Thread Bruno Desthuilliers
Paul Rubin a écrit : > brad <[EMAIL PROTECTED]> writes: > >>Does anyone else feel that unittesting is too much work? Not in >>general, just the official unittest module for small to medium sized >>projects? > > > Yeah, unittest is sort of a Java-ism. You might try the newer doctest > module ins

Re: What does the syntax [::-1] really mean?

2007-10-04 Thread Duncan Booth
Duncan Booth <[EMAIL PROTECTED]> wrote: > the invariant that you are looking for is that for all non-negative a, b: >x[a:b:1] reversed is x[-len(x)+b-1:-len(x)+a-1:-1] > I should of course have said "all a, b in the range 0 <= a <= len(x) and 0 <= b <= len(x)". -- http://mail.python.org/mai

[OT, definitively] Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-04 Thread Bruno Desthuilliers
J. Clifford Dyer a écrit : > On Thu, Oct 04, 2007 at 04:49:50PM +0200, Wildemar Wildenburger wrote > regarding Re: The Modernization of Emacs: terminology buffer and > keybinding: > >> Steve Holden wrote: >>> Lawrence D'Oliveiro wrote: In message <[EMAIL PROTECTED]>, Steve Holden w

Re: unit testing

2007-10-04 Thread Jeffrey Froman
Chris Mellon wrote: > Doctest is commonly given as the alternative to people who feel this > way. Personally, I find that anything worth testing is worth having a > test directory and independent unit tests for. I like keeping my tests separate as well, and doctest does allow this, using doctest.

Re: unit testing

2007-10-04 Thread Tim Chase
>>> Does anyone else feel that unittesting is too much work? Not in general, >>> just the official unittest module for small to medium sized projects? > [snip] >> I actually do a lot of unit testing. I find it both annoying and >> highly necessary and useful. > > +1 QOTW. > > I feel exactly the

Re: What does the syntax [::-1] really mean?

2007-10-04 Thread Duncan Booth
Casey <[EMAIL PROTECTED]> wrote: > From this, I would expect that x[::-1] would be identical to x[n:0:-1] > (n and 0 being the "end" values, with the order switched due to the > negative step value). But the clause that "(but never including j)" > means that x[n:0:-1] excludes the 1st element of

Dynamically creating class properties

2007-10-04 Thread Karlo Lozovina
Hi all, this is my problem: lets say I have a arbitrary long list of attributes that I want to attach to some class, for example: l = ['item1', 'item2', 'item3'] Using metaclasses I managed to create a class with those three attributes just fine. But now I need those attributes to be prop

Re: What does the syntax [::-1] really mean?

2007-10-04 Thread Casey
On Oct 4, 4:32 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > Duncan Booth <[EMAIL PROTECTED]> wrote: > > the invariant that you are looking for is that for all non-negative a, b: > >x[a:b:1] reversed is x[-len(x)+b-1:-len(x)+a-1:-1] > > I should of course have said "all a, b in the range 0 <= a

Re: What does the syntax [::-1] really mean?

2007-10-04 Thread Casey
On Oct 4, 4:58 pm, Casey <[EMAIL PROTECTED]> wrote: > Thanks, again! I figured it out from Fred's and your initial posts. Oops - I meant Kurt, not Fred. Sorry for the mis-attribution! -- http://mail.python.org/mailman/listinfo/python-list

Is there a nicer way to do this?

2007-10-04 Thread Stefan Arentz
Is there a better way to do the following? attributes = ['foo', 'bar'] attributeNames = {} n = 1 for attribute in attributes: attributeNames["AttributeName.%d" % n] = attribute n = n + 1 It works, but I am wondering if there is a more pythonic way to do this. S. -- http://mail.python.o

Re: Owner of spawned process in threads

2007-10-04 Thread Piet van Oostrum
> "Vishal Sethia" <[EMAIL PROTECTED]> (VS) wrote: >VS> Just trying to understand the behaviour of spawn. Consider I have a >VS> function which creates two threads. And in one of the threads I make a >VS> call to pexpect.spawn. spawn would fork and create a new new child In >VS> this case who b

Re: Is there a nicer way to do this?

2007-10-04 Thread Casey
Not sure if this is really better or even more pythonic, but if you like one-liners that exercise the language: attributeNames = dict( [("AttributeName.%d" % (n+1), attribute) for n,attribute in enumerate(attributes)] ) What this does is create a list (using a list comprehension and the enumerate

Re: Is there a nicer way to do this?

2007-10-04 Thread Tim Chase
> attributes = ['foo', 'bar'] > > attributeNames = {} > n = 1 > for attribute in attributes: >attributeNames["AttributeName.%d" % n] = attribute >n = n + 1 > > It works, but I am wondering if there is a more pythonic way to > do this. "Better" may be subjective, but you could do somethin

Re: Is there a nicer way to do this?

2007-10-04 Thread Amaury Forgeot d'Arc
Hello, Stefan Arentz a écrit : > Is there a better way to do the following? > > attributes = ['foo', 'bar'] > > attributeNames = {} > n = 1 > for attribute in attributes: >attributeNames["AttributeName.%d" % n] = attribute >n = n + 1 > > It works, but I am wondering if there is a more py

Re: RegEx question

2007-10-04 Thread John Masters
On 15:25 Thu 04 Oct , Robert Dailey wrote: > I am not a regex expert, I simply assumed regex was standardized to follow > specific guidelines. There are as many different regex flavours as there are Linux distros. Each follows the basic rules but implements them slightly differently and adds t

Re: Is there a nicer way to do this?

2007-10-04 Thread Terry Reedy
"Stefan Arentz" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | | Is there a better way to do the following? | | attributes = ['foo', 'bar'] | | attributeNames = {} | n = 1 | for attribute in attributes: | attributeNames["AttributeName.%d" % n] = attribute | n = n + 1 | | It wor

Re: Howto Launch a windows application ?

2007-10-04 Thread stef mientki
Yu-Xi Lim wrote: > stef mientki wrote: > >> cmd =[] >> cmd.append ( 'D:\\PIC-tools\\JALxxx\\jalv2_3.exe' ) >> cmd.append ( '-long-start' ) >> cmd.append ( '-d') >> cmd.append ( '-clear' ) >> cmd.append ( '-sD:\\PIC-tools\\JAL\\libs2' ) >> cmd.append ( >> 'd:\\pic-tools\\jal\\programs\\test_rs23

Re: Is there a nicer way to do this?

2007-10-04 Thread Paul Hankin
On Oct 4, 10:53 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > However, mapping indexes to names should be more useful: > > >>> aNames = dict(enumerate(['foo', 'bar'])) > >>> aNames > > {0: 'foo', 1: 'bar'} If you are right that a map from indices to name is best, there's no need for a dict: the

PYTHONPATH, opensuse10.2, gtk not working

2007-10-04 Thread Silfheed
Heyas So I'm trying to do two things, install a little gnome taskbar applet (timer-applet) that was written in python and experiment with writing python gtk apps. I've installed (through yast) gtk, gtk2, gtk2-devel, python-gtk, python-gtk-devl, python-gtk-doc but I still cant get python to import

Re: Is there a nicer way to do this?

2007-10-04 Thread Casey
On Oct 4, 5:42 pm, Casey <[EMAIL PROTECTED]> wrote: > Not sure if this is really better or even more pythonic, but if you > like one-liners that exercise the language: Hmm, I guess it WAS more pythonic, since three of us gave essentially identical responses in a 10-minute period. That being said,

Re: Howto Launch a windows application ?

2007-10-04 Thread stef mientki
Matimus wrote: > stef mientki wrote: > >> hello, >> >> I'm trying to launch a windows application, >> but as many others on this list, I've some trouble. >> I read some other threads about this topic, >> but sorry, I still don't understand all this (never heard of pipes). >> >> When I use a batc

Re: Is there a nicer way to do this?

2007-10-04 Thread Victor B. Gonzalez
On Thursday 04 October 2007 5:07:51 pm Stefan Arentz wrote: > Is there a better way to do the following? > > attributes = ['foo', 'bar'] > > attributeNames = {} > n = 1 > for attribute in attributes: >attributeNames["AttributeName.%d" % n] = attribute >n = n + 1 > > It works, but I am wonde

Re: What does the syntax [::-1] really mean?

2007-10-04 Thread Robert Kern
Casey wrote: > On Oct 4, 4:32 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: >> Duncan Booth <[EMAIL PROTECTED]> wrote: >>> the invariant that you are looking for is that for all non-negative a, b: >>>x[a:b:1] reversed is x[-len(x)+b-1:-len(x)+a-1:-1] >> I should of course have said "all a, b in t

Re: Python "implements " equivalent?

2007-10-04 Thread Terry Reedy
"Wojciech Gryc" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi, | | I recently started using Python and am extremely happy with how | productive it's made me, even as a new user. I'm hoping to continue | using the language for my research, and have come across a bit of a | stumb

Re: setuptools without unexpected downloads

2007-10-04 Thread Gabriel Genellina
En Wed, 03 Oct 2007 08:21:04 -0300, Max Erickson <[EMAIL PROTECTED]> escribi�: > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > ... >> This recent blog post contains step-by-step instructions on using >> free tools to compile python extensions: >>

Re: Dynamically creating class properties

2007-10-04 Thread Paul Hankin
On Oct 4, 9:59 pm, Karlo Lozovina <[EMAIL PROTECTED]> wrote: > Hi all, > > this is my problem: lets say I have a arbitrary long list of attributes > that I want to attach to some class, for example: > > l = ['item1', 'item2', 'item3'] > > Using metaclasses I managed to create a class with thos

Re: enumerate overflow

2007-10-04 Thread Gabriel Genellina
En Wed, 03 Oct 2007 08:46:31 -0300, <[EMAIL PROTECTED]> escribi�: > in python2.4, i read lines from a file with > > for lineNum, line in enumerate(f): ... > > However, lineNum soon overflows and starts counting backwards. How do > i force enumerate to return long integer? (what kind of files are

Mysql class works like php

2007-10-04 Thread Andrey
Hi just a quick question about using MySQL module... are there any api / class available to give a higher level in working with Mysql in python? such as db.fetch_array(), db.fetch_rows(), db.query(), for eachrow in db.fetch_array(): just as easy as PHP? I think someone might already don

Re: Dynamically creating class properties

2007-10-04 Thread Paul Hankin
On Oct 4, 11:55 pm, Paul Hankin <[EMAIL PROTECTED]> wrote: > On Oct 4, 9:59 pm, Karlo Lozovina <[EMAIL PROTECTED]> wrote: > > > > > Hi all, > > > this is my problem: lets say I have a arbitrary long list of attributes > > that I want to attach to some class, for example: > > > l = ['item1', 'i

Re: module confusion

2007-10-04 Thread Steven D'Aprano
On Thu, 04 Oct 2007 23:01:06 +1300, Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Steven D'Aprano wrote: > >> ... pedants ... > > When people use that word against me, it's generally a sign they're > trying not to admit I'm right. Yeah, you keep telling yourself that. What does

Re: module confusion

2007-10-04 Thread MRAB
On Oct 4, 11:11 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Hendrik van Rooyen wrote: > > "Steve Holden" wrote: > > >> religious issues for me. It's more like "This problem has a cross head, > >> so I'll need a Philips screwdriver". > > > As long as it is not a Pozidrive, that is a commendable a

Re: Using fractions instead of floats

2007-10-04 Thread Steven D'Aprano
On Thu, 04 Oct 2007 02:47:27 -0700, Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> > implementation in pure Python). Finally, arithmetic would become >> > very confusing if there were three distinct numeric types; it already >> > causes enough confusion with two! > > There's

Re: Using fractions instead of floats

2007-10-04 Thread Steven D'Aprano
On Tue, 02 Oct 2007 06:07:15 +, Rhamphoryncus wrote: > On Sep 30, 7:35 pm, andresj <[EMAIL PROTECTED]> wrote: >> I was doing some programming in Python, and the idea came to my mind: >> using fractions instead of floats when doing 2/5. > > The core problem with rationals (other than the inabi

Re: module confusion

2007-10-04 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Steven D'Aprano wrote: > What does type(os.path) return when you try it? It returns the type of the value contained in that variable, of course: >>> import os >>> os.path = 3 >>> type(os.path) See, it's just a variable, like any other. -- http:/

Re: Dynamically creating class properties

2007-10-04 Thread Michael Spencer
Karlo Lozovina wrote: > > Any idea how to do that with metaclasses and arbitrary long list of > attributes? I just started working with them, and it's driving me nuts :). > > Thanks for the help, > best regards. > Try implementing a property factory function before worrying about the metaclas

Re: Starting a thread before wxPython bootup ... interesting.

2007-10-04 Thread [david]
Since the observed behaviour is clearly undefined, I forgive you for the poorly specified behaviour description: asking for a close description of random behaviour is just ridiculous. The most obvious point is that wx is not re-entrant or thread safe: you have to make it so by using wx.CallAfter()

RE: unit testing

2007-10-04 Thread Ryan Ginstrom
> On Behalf Of Bruno Desthuilliers > Or py.test or nose, which are both more complete than doctest > and more pythonics than the unittest module. I second the recommendation of nose. It makes it fantastically easy to write and run unit tests. Also, in my experience unit tests help reduce bugs in

Re: Announcing the RosAsm Library Project

2007-10-04 Thread Evenbit
On Oct 4, 6:29 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hey, Rene, > > Let's pretend for a moment that we're all on "Planet Betov" where > using statically linked library code is never done and all code reuse > is accomplished by "cut & paste". > > In this dream world, here's what I see

Re: Python and SSL

2007-10-04 Thread John Nagle
Johny wrote: > Martin and John, > Thank you both for your replies > Must I have OpenSSL imported in my Python program? > So far I have been using only SSL support. > Built-in SSL support works OK if I connect from my Python program > directly to SSL server ( but not via proxy). > L. SSL is

Re: Announcing the RosAsm Library Project

2007-10-04 Thread [EMAIL PROTECTED]
On Oct 4, 6:36 pm, Evenbit <[EMAIL PROTECTED]> wrote: > > This is extremely easy to answer. The average RosAsm coder tends to > only make use of the libraries documented here: > > http://msdn2.microsoft.com/en-us/library/aa383749.aspx Which is a bit limiting, wouldn't you agree? > > If you wish

Re: PYTHONPATH, opensuse10.2, gtk not working

2007-10-04 Thread Steve Holden
Silfheed wrote: > Heyas > > So I'm trying to do two things, install a little gnome taskbar applet > (timer-applet) that was written in python and experiment with writing > python gtk apps. I've installed (through yast) gtk, gtk2, gtk2-devel, > python-gtk, python-gtk-devl, python-gtk-doc but I sti

Re: module confusion

2007-10-04 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Neil Cerutti wrote: > On 2007-10-03, Lawrence D'Oliveiro <[EMAIL PROTECTED]> > wrote: >> In message <[EMAIL PROTECTED]>, Ben Finney wrote: >> >>> Lawrence D'Oliveiro <[EMAIL PROTECTED]> writes: >>> On my Gentoo system: >>> import os >>>

Re: Python "implements " equivalent?

2007-10-04 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Wojciech Gryc wrote: > I'm a seasoned Java programmer and quite a big fan of interfaces... > i.e. The idea that if I make a number of distinct classes that > implement interface X, I can pass them all as parameters to functions > or whatnot that require an X object.

tkinter question

2007-10-04 Thread goldtech
This works OK. But I notice that if I enlarge the window after the script has run, the white listbox only gets "so" big while the grey background enlarges. Is there a way to have it all white when I enlarge a window - like what normally happens? from Tkinter import * root = Tk() root.title("Dir

Cross platform way of finding number of processors on a machine?

2007-10-04 Thread John
Is there a way to find the number of processors on a machine (on linux/ windows/macos/cygwin) using python code (using the same code/cross platform code)? -- http://mail.python.org/mailman/listinfo/python-list

Re: PYTHONPATH, opensuse10.2, gtk not working

2007-10-04 Thread Silfheed
On Oct 4, 7:39 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Silfheed wrote: > > Heyas > > > So I'm trying to do two things, install a little gnome taskbar applet > > (timer-applet) that was written in python and experiment with writing > > python gtk apps. I've installed (through yast) gtk, gtk2,

RE: Python 3.0 migration plans?

2007-10-04 Thread Delaney, Timothy (Tim)
TheFlyingDutchman wrote: > On Sep 28, 1:09 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > >> That's because the tutor list doesn't offer a newsgroup. He was >> probably just trying to get rid of you. >> >> Now at 98.75% ... > > Not sure if that's the reading on your trollmeter or on the meter th

Re: Cross platform way of finding number of processors on a machine?

2007-10-04 Thread Nicholas Bastin
On 10/4/07, John <[EMAIL PROTECTED]> wrote: > > Is there a way to find the number of processors on a machine (on linux/ > windows/macos/cygwin) using python code (using the same code/cross > platform code)? There's no single call that will give you the same info on every platform, but you can obvi

Re: Python 3.0 migration plans?

2007-10-04 Thread Nicholas Bastin
On 9/27/07, Steve Holden <[EMAIL PROTECTED]> wrote: > I wondered if a straw poll could get some idea of readers' thoughts > about when they will be migrating to 3.0 on, so I used the new widget on > Blogger to add a poll for that. > > I'd appreciate if if you would go to > >http://holdenweb.blo

ANN: Chandler Preview (0.7.0.1)

2007-10-04 Thread Heikki Toivonen
Open Source Applications Foundation (OSAF) released Chandler Preview (0.7.0.1) on September 10, 2007. Chandler is a Personal Information Management (PIM) client application with innovative design and ambitious plans for sharing, extensibility and cross-platform support. Chandler is written mainly

Re: Howto Launch a windows application ?

2007-10-04 Thread Nicholas Bastin
On 10/3/07, stef mientki <[EMAIL PROTECTED]> wrote: > hello, > > I'm trying to launch a windows application, > but as many others on this list, I've some trouble. > I read some other threads about this topic, > but sorry, I still don't understand all this (never heard of pipes). > > When I use a ba

Re: Is there a nicer way to do this?

2007-10-04 Thread Terry Reedy
"Paul Hankin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Oct 4, 10:53 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: | > However, mapping indexes to names should be more useful: | > | > >>> aNames = dict(enumerate(['foo', 'bar'])) | > >>> aNames | > | > {0: 'foo', 1: 'bar'} |

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-04 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Grant Edwards wrote: > You've got to admit that Tk "just works", although as a result > it looks ugly and foreign on all platforms. Sort of a "pidgin GUI". :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Duplicate content filter..

2007-10-04 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Abandoned wrote: > I want to a idea for how can i find duplicate pages quickly and fast ? Compute a hash based on a canonicalized version of the content? Disregard white space, line wrap, upper/lower case, possibly even punctuation etc so that you get the same hash

Re: Combine two dictionary...

2007-10-04 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Abandoned wrote: > I want to total score.. > For example >> > dict1={1: 4, 3: 5}... and 2 millions element >> > dict2={3: 3, 8: 6}... and 3 millions element > > result should be dict3={1:4, 3:8, 8:6} Don't people like one-liners? :) dict((k, dict1.get(k, 0)

Re: Is there a nicer way to do this?

2007-10-04 Thread Stefan Arentz
Stefan Arentz <[EMAIL PROTECTED]> writes: > Is there a better way to do the following? > > attributes = ['foo', 'bar'] > > attributeNames = {} > n = 1 > for attribute in attributes: >attributeNames["AttributeName.%d" % n] = attribute >n = n + 1 > > It works, but I am wondering if there

Re: module confusion

2007-10-04 Thread Robert Kern
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Steven D'Aprano wrote: > >> What does type(os.path) return when you try it? > > It returns the type of the value contained in that variable, of course: > > >>> import os > >>> os.path = 3 > >>> type(os.path) > > > See

Re: Python and SSL

2007-10-04 Thread Johny
On Oct 5, 3:50 am, John Nagle <[EMAIL PROTECTED]> wrote: > Johny wrote: > > Martin and John, > > Thank you both for your replies > > Must I have OpenSSL imported in my Python program? > > So far I have been using only SSL support. > > Built-in SSL support works OK if I connect from my Python pro

Re: Real time plot

2007-10-04 Thread Nicholas Bastin
On 10/4/07, Jean-Francois Canac <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] > > I would draw dots on a suitably sized Tkinter canvas, after drawing a > > schematic > > of the race track (laborious). > > > > 20 per second will be no problem, provided the machine is half decent. > > > > What is th

Re: Adding behaviour for managing "task" dependencies

2007-10-04 Thread rayrayson
On Oct 2, 2:23 pm, Paddy <[EMAIL PROTECTED]> wrote: > You could use a professional Job scheduling system such as LSF or Sun Grid > Engine > that both support job dependencies (and a whole lot more). Recently, Grid Engine added support the powerful "Array Job Interdependencies" support. http://gr

<    1   2