Re: Large algorithm issue -- 5x5 grid, need to fit 5 queens plus some squares

2006-03-16 Thread Tim Roberts
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: > >> The problem I'm trying to solve is. >> There is a 5x5 grid. >> You need to fit 5 queens on the board such that when placed there are >> three spots left that are not threatened by the queen. > >when you're done with your hom

Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-16 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >Just tried Ruby over the past two days. I won't bore you >with the reasons I didn't like it, however one thing really >struck me about it that I think we (the Python community) >can learn from. > >Ruby has ... an issue with docs. That is to say, there are >almost none. .

Re: My Generator Paradox!

2006-03-16 Thread Fredrik Lundh
"vbgunz" wrote: > I am afraid that this is the first time in which I would probably need > something explained to me as if I were a little child. I am having a > hard time getting this through my thick skull. What in the world is > wrong with this!? > > '''

Re: Is there a python library to parse C++ code file?

2006-03-16 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Is there a python library to parse C++ code file? > If yes, can you please tell me where is it? depends on how you want to parse the file, and what information you want to extract. without more details, I'd recommend http://www.gccxml.org/HTML/Index.html combined

Re: Loop Backwards

2006-03-16 Thread Tim Roberts
"Dave" <[EMAIL PROTECTED]> wrote: > >Please be mindful of making statements such as: >"it's silly to believe both will behave equally" > >One of the greatest weaknesses of Python is the less than friendly >attitude Pythonistas display towards one another. I don't know how much Usenet experience yo

Weekly Python Patch/Bug Summary

2006-03-16 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 392 open ( +6) / 3094 closed ( +5) / 3486 total (+11) Bugs: 907 open (+18) / 5646 closed (+10) / 6553 total (+28) RFE : 213 open ( +1) / 202 closed ( +1) / 415 total ( +2) New / Reopened Patches __ new exit

Re: Threads modify "global" variable -- asking for trouble?

2006-03-16 Thread Terry Reedy
"J Rice" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > My apologizes, I missed the newish FAQ entry on this. The addrbl() > method looks like this: > > def addRBL(self, testname, result, info=""): >self.testresultsRBL[testname] = result, info > > So according to the FAQ

Re: Threads modify "global" variable -- asking for trouble?

2006-03-16 Thread Alex Martelli
J Rice <[EMAIL PROTECTED]> wrote: > My apologizes, I missed the newish FAQ entry on this. The addrbl() > method looks like this: > > def addRBL(self, testname, result, info=""): > self.testresultsRBL[testname] = result, info > > So according to the FAQ, D[x] = y, where D is a dictionar

Re: need some help in reading error message

2006-03-16 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > I need some help in reading error message: which line has problem? line > 233? or line 37? > > Thank you. > > $ ./read2.py log.xml > Traceback (most recent call last): > File "./read2.py", line 233, in ? > parser.parse(open(inputFileName)) > File "/usr/lib/py

need some help in reading error message

2006-03-16 Thread Allerdyce . John
I need some help in reading error message: which line has problem? line 233? or line 37? Thank you. $ ./read2.py log.xml Traceback (most recent call last): File "./read2.py", line 233, in ? parser.parse(open(inputFileName)) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.p

Re: Threads modify "global" variable -- asking for trouble?

2006-03-16 Thread J Rice
My apologizes, I missed the newish FAQ entry on this. The addrbl() method looks like this: def addRBL(self, testname, result, info=""): self.testresultsRBL[testname] = result, info So according to the FAQ, D[x] = y, where D is a dictionary, is atomic and therefore thread-safe. Right?

Threads modify "global" variable -- asking for trouble?

2006-03-16 Thread J Rice
I have been experimenting with some thread programming, but as I'm doing this on my own I am worried I might be making a major mistake. Here's a brief rundown of what I am working on. Multiple threads, via Queue, are used to perform RBL checks on an IP. The threads are passed a defined class (Co

Re: Large algorithm issue -- 5x5 grid, need to fit 5 queens plus some squares

2006-03-16 Thread [EMAIL PROTECTED]
Sorry to bring this up again, but I decided to try to re-create the program, using the 2d array. However, I ran into a slight problem. How will the permutation function have to be modified? I'm having issues trying to figure out how it works, and how it would need to be modified to use it correct

Re: Queue limitations?

2006-03-16 Thread Metalone
This example is missing a few initialization details although they can possibly be inferred. For example is iq = imageQueue() but imageQueue does not have a put() method. Is SetQueue() called? Is iq.start() called? I like to see small, fully complete and tested examples. The following works using

Is there a python library to parse C++ code file?

2006-03-16 Thread Allerdyce . John
Is there a python library to parse C++ code file? If yes, can you please tell me where is it? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: python newbie, linux novice, needs to run spamassassin

2006-03-16 Thread Lonnie Princehouse
I don't know spamassassin's exact set up, but usually procmail spam filters read an email message from standard input and produce an exit code that tells you if the message is spam or not. So from the Python side, it should be as easy as running whatever the command is (a quick googling suggests i

How to search XML? Are there special libs?

2006-03-16 Thread Sullivan WxPyQtKinter
I am now using XML to record my lab records in quite a complex way, in which about 80 tags are used to identify different types of data. I think it is a good idea to search for a popular and mature XML search engine before I started to program it myself: I need the following functions: Search and

Re: "pow" (power) function

2006-03-16 Thread Terry Reedy
"Mike Ressler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have a counterexample. In the original timeit example, 111**111 was > used. When I run that > timeit.Timer("pow(111,111)").timeit() > 10.968398094177246 timeit.Timer("111**111").timeit() > 10.04007887840271 >

Re: accessing a USB HID

2006-03-16 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > I've been teaching myself Python as part of my senior design project at > university. > > The obstacle our group currently faces is communicating with a > microcontroller (ACS USB Servo II) that appears in Windows as a USD > HID. Unfortunately, the vendor's sample code is

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread [EMAIL PROTECTED]
-- The states are lists of regular expressions -- where [a,b,..] means match a or b or... I haven't run or studied your program yet myself but what I had in mind was that the list of wc's are *all* to be excluded, so the list [wc1..wcn] is to correspond generating all tuples matching not(wc1 and .

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread Wade Humeniuk
Oops, problems cutting an pasting, should be, ;; Wade Humeniuk (defclass odometer () ((base :initform 0 :accessor base) (meter :initform nil :accessor meter) (n-digits :initarg :n-digits :accessor n-digits) (digit-set :initarg :digit-set :accessor digit-set))) (defmethod initializ

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread Wade Humeniuk
[EMAIL PROTECTED] wrote: > What I have in mind is the efficient, generation of the > complement S^n/WC(S^n). A good program should initialize, generate, and > terminate. > > T=cartprodex(S,n,WC); //initialize > for all i in T do > what you want with i > test to see if any more > terminate i

Re: Python / glade fundamentals

2006-03-16 Thread Dave Cook
On 2006-03-16, Doug <[EMAIL PROTECTED]> wrote: > Can someone tell me why I do not get a connection between the events and > the functions in the sample below. GUI window appears OK, just no > connections seem to be made. > I am new to this so may be missing something fundamental. This might be

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread Dan Piponi
Is this Haskell implementation what you want? It does the wildcard matching through a state machine and it essentially threads the state machine through the cartesian product, switching to the ordinary cartesian product when possible as an optimisation. The execution of the state machine is shared

Re: Cheese Shop: some history for the new-comers

2006-03-16 Thread Paul Boddie
Fredrik Lundh wrote: > > since when is Microsoft a programming language ? Well, to many a recruiter or middle-manager it almost is a kind of programming language, given their often vague usage of that and other product and technology names. But anyway, people who call themselves "Java developers",

Re: Xah's Edu Corner: The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations

2006-03-16 Thread Xah Lee
Xah Lee wrote: « The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations http://xahlee.org/UnixResource_dir/writ/notations.html » A side note: the terminology “Algebraic” Notation is a misnomer. It seems to imply that such notations have something to do with the br

accessing a USB HID

2006-03-16 Thread jodansmif
I've been teaching myself Python as part of my senior design project at university. The obstacle our group currently faces is communicating with a microcontroller (ACS USB Servo II) that appears in Windows as a USD HID. Unfortunately, the vendor's sample code is in Visual Basic and Visual C++ whic

Re: My Generator Paradox!

2006-03-16 Thread [EMAIL PROTECTED]
vbgunz wrote: > I am afraid that this is the first time in which I would probably need > something explained to me as if I were a little child. I am having a > hard time getting this through my thick skull. What in the world is > wrong with this!? > > ''' ##

Re: "pow" (power) function

2006-03-16 Thread Ben Cartwright
Mike Ressler wrote: > >>> timeit.Timer("pow(111,111)").timeit() > 10.968398094177246 > >>> timeit.Timer("111**111").timeit() > 10.04007887840271 > >>> timeit.Timer("111.**111.").timeit() > 0.36576294898986816 > > The pow and ** on integers take 10 seconds, but the float ** takes only > 0.36 seconds

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread [EMAIL PROTECTED]
The asterisk '*' matches any sequence of elements, not just one element. The wildcard '*1*2*' would then correspond to a tuple with a 1 preceding a 2 in any positions. The wc '1*2' would correspond to a starting 1 and an ending 2 with anything in between. The wc *12* would correspond to a 1 adjacen

Re: My Generator Paradox!

2006-03-16 Thread Schüle Daniel
it's easy to explain class X: pass x=X() y=X() x and y are different instances one can put in x x.item = 1 y doesn't even have an attribute item for example similar with generators they are *different* objects of same kind generator >>> def fib(): ... a,b = 1,1 ... while True:

Re: My Generator Paradox!

2006-03-16 Thread David Wahler
vbgunz wrote: > I am afraid that this is the first time in which I would probably need > something explained to me as if I were a little child. I am having a > hard time getting this through my thick skull. What in the world is > wrong with this!? > > ''' ###

Re: My Generator Paradox!

2006-03-16 Thread Michal Kwiatkowski
vbgunz wrote: > def generatorFunction(sequence=['item1', 'item2', 'item3']): > for item in sequence: > yield item > > yieldedValue = generatorFunction() You're creating an iterator here and binding it to name yieldedValue (which is bogus, it should be named valueGenerator or sth like

Re: My Generator Paradox!

2006-03-16 Thread Felipe Almeida Lessa
Em Qui, 2006-03-16 às 16:17 -0800, vbgunz escreveu: > print generatorFunction() # > print generatorFunction().next()# item1 > print generatorFunction().next()# item1 > print generatorFunction().next()# item1 Each time you say "generatorFunction()", it gives you a new genera

Converting to ARGB and writing to a bitmap

2006-03-16 Thread heathimself
Hi, I don't know what type of files they are, but the script allows me to save to a bitmap just fine. But I do know they need to be in RGBA format, so I've followed what most of the tutorials for RGBA conversions said to do...shifting the bytes. The major problem is that everything is in gree

My Generator Paradox!

2006-03-16 Thread vbgunz
I am afraid that this is the first time in which I would probably need something explained to me as if I were a little child. I am having a hard time getting this through my thick skull. What in the world is wrong with this!? ''' ### ''' def

python newbie, linux novice, needs to run spamassassin

2006-03-16 Thread Gates Danderhoff
The frustrating thing about running linux is that every time you look for an example using a search engine, the guy writing it expects you to know 10 other utilities. I have a very simple request regarding spamassain: I just need an example of how to run it once you have downloaded one or more ema

Re: TypeError: unsupported operand type(s) for -: 'tuple' and 'tuple'

2006-03-16 Thread Jay Parlar
On Mar 16, 2006, at 3:14 PM, Peter Bismuti wrote: > Can anyone explain this error message?  > > Traceback (most recent call last): >   File "/acct/pjb9508/RAT/Scripts/PyQt/RatDialog.py", line 30, in > NewClipButton_clicked >     > self.rat.planeClip(self.o,"SQUARE"+str(self.squareCounter),w

Re: how to get 20000 html pages content quickly from one server?

2006-03-16 Thread Bruno Desthuilliers
JuHui a écrit : > in fact, I want to do a script to get news on others site. Then ask the webmasters of theses sites if they do have a ress feed... -- http://mail.python.org/mailman/listinfo/python-list

Re: Xah's Edu Corner: The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations

2006-03-16 Thread Jeffrey Schwab
SamFeltus wrote: > """Not that Mr. Lee has ever shown much interest in feedback, but you > pretty well have stick to vanilla ASCII to get your notation through > unmangled on newsgroups.""" > > It is the 21st century, so having to do that oughta inspire some sort > of well earned anti Unix rant...

Re: Xah's Edu Corner: The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations

2006-03-16 Thread SamFeltus
"""Not that Mr. Lee has ever shown much interest in feedback, but you pretty well have stick to vanilla ASCII to get your notation through unmangled on newsgroups.""" It is the 21st century, so having to do that oughta inspire some sort of well earned anti Unix rant... :) -- http://mail.python.

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread Marcin 'Qrczak' Kowalczyk
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > The python code below generates a cartesian product subject to any > logical combination of wildcard exclusions. For example, suppose I want > to generate a cartesian product S^n, n>=3, of [a,b,c,d] that excludes > '*a*b*' and '*c*d*a*'. See below

Re: recycling internationalized garbage

2006-03-16 Thread Ross Ridge
Martin v. Löwis wrote: > So "valid" yes; "meaningful" no. Therefore, for all practical > purposes, 8-bit single-byte characters sets *will not* produce > byte sequences that are valid in UTF-8 (although they could - > it just won't happen). > > > In fact I can't think of any multi-byte encoding tha

TypeError: unsupported operand type(s) for -: 'tuple' and 'tuple'

2006-03-16 Thread Peter Bismuti
Can anyone explain this error message?  Traceback (most recent call last):   File "/acct/pjb9508/RAT/Scripts/PyQt/RatDialog.py", line 30, in NewClipButton_clicked     self.rat.planeClip(self.o,"SQUARE"+str(self.squareCounter),width,origin)   File "/acct/pjb9508/RAT/Scripts/PyQt/rat.py", line 12,

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread sa
in k: cp:{[c;n;p]+(n#c)_vs(!_ c^n)_dvl,/{2_sv+(,/,/:\:)/(),/:@[x;&x=-1;:[;!c]]}'p} examples: cp[2;3;,0 -1 1] (0 0 0 0 1 0 1 0 0 1 0 1 1 1 0 1 1 1) cp[2;3;(0 -1 1;1 -1 0)] (0 0 0 0 1 0 1 0 1 1 1 1) cp[2;3;(0 -1 1;1 -1 1)] (0 0 0 0 1 0 1 0 0 1 1 0) arguments of cp: c = cardina

TypeError: unsupported operand type(s) for -: 'tuple' and 'tuple'

2006-03-16 Thread Peter Bismuti
 Strange, I don't get this error when using pure Python, only when using PyQt.  Can anyone tell me what is going on here?  Thanks!  File "/acct/pjb9508/RAT/Scripts/PyQt/RatDialog.py", line 30, in NewClipButton_clicked     self.rat.planeClip(self.o,"SQUARE"+str(self.squareCounter),width,origi

Re: Cheese Shop: some history for the new-comers

2006-03-16 Thread Peter Decker
On 3/16/06, Terry Hancock <[EMAIL PROTECTED]> wrote: > But the usual distinction (on any project web page) is > "User" versus "Developer". > > Who is a "user" of Python? That would be you, right? It > would be fairly silly to have a page only for people who > have programs written in Python that t

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread funkyj
NOTE: I am a lisp newbie. I'm sure our resident lisp experts can create much better (both faster, shorter and clearer) solutions than the one above. Even I could have created something shorter but I thought it would be fun to apply the "utility function" approach in decomposing the problem. --

Re: Counting nested loop iterations

2006-03-16 Thread Jeffrey Schwab
Derek Basch wrote: >> Depending on the types of the containers in question, you could use: >> >> len(zoo) * len(animal) > > I think this would give me the total iterations but I wouldn't be able > to get a running count. Correct? Correct. If you need a running count, maintain a counter (or

Re: Counting nested loop iterations

2006-03-16 Thread Derek Basch
Carl Banks wrote: > But even the clear version isn't as nearly clear and straightforward as > the nested fors with the counter. I wouldn't forsake that clarity just > so it isn't "kludgy". > > > Carl Banks Yeah, looks like using the counters is clearer. Thanks for the opinions everyone! Derek B

Re: Python IDE: great headache....

2006-03-16 Thread Dag Fjeld Edvardsen
> Come to think of it, the only exception is probably that PyScripter (AFAIK) > does not provide conditional pause. Quoting myself :) But now it does! Conditional breakpoints were introduced in the new version released on the 14th of March: http://mmm-experts.com/ -Dag -- http://mail.python

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread funkyj
here is my version of the same. REPL output: CL-USER> (tests) set = (1 2) n= 3 patterns = ((1 ANY 2)) --- (1 1 1) (1 2 1) (2 1 1) (2 1 2) (2 2 1) (2 2 2) set = (A B) n= 3 patterns = ((A ANY B) (B ANY A)) --- (A A A) (A B A) (B

Re: Counting nested loop iterations

2006-03-16 Thread Carl Banks
Derek Basch wrote: > What is the best way to count nested loop iterations? I can only figure > to use an index but that seems kludgy. > > index = 0 > for animal in zoo: > for color in animal: > index += 1 I don't know if it's kludgy, but I do prefer to set counters in the for statement

Re: Python Debugger / IDE ??

2006-03-16 Thread Rowdy
Don Taylor wrote: > Is there a free or low-cost version of Delphi for Windows available > anywhere? > There used to be a Delphi 6 Personal Edition that was available free (for non-commercial use). You might still find it around somewhere. Rowdy -- http://mail.python.org/mailman/listinfo/pyt

Re: Counting nested loop iterations

2006-03-16 Thread Duncan Booth
Derek Basch wrote: > index = 0 > for animal in zoo: > for color in animal: > index += 1 # assuming there is something more goes here... > You could do this, but it kind of depends what the loop *really* looks like: for index, color in enumerate(color

Re: Other languages for PVM

2006-03-16 Thread Ravi Teja
I did not mean the lack of interest on part of the developer. That was explained here. http://www.livelogix.net/logix/future-work.html His complaints were Efficiency and Security. I was wondering why the Python community did not show interest in this. There is tremendous potential in this product.

Re: Binary python extensions with Free Pascal Compiler

2006-03-16 Thread Caleb Hattingh
Well, there it is: * Added support for Free Pascal Compiler (http://www.freepascal.org/) and Lazarus Project (http://www.lazarus.freepascal.org/) Thanks to Michiel du Toit ([EMAIL PROTECTED]) That was easy. I just saw the new support for D2k6 recently. thx Ravi Caleb -- http://mail.python.or

Re: Counting nested loop iterations

2006-03-16 Thread Kent Johnson
Derek Basch wrote: > Fredrik Lundh wrote: >>(the real question here is of course why you need the counter. what's >>the loop doing? if the code you posted is all you have, you can replace >>it with index = sum(len(animal) for animal in zoo), but I assume you want >>to do more stuff in there...) >

Re: Binary python extensions with Free Pascal Compiler

2006-03-16 Thread Ravi Teja
I posted this a few days ago. According to the website (http://mmm-experts.com/VersionHistory.aspx?ProductId=3), FPC support has been added since version 3.29. -- http://mail.python.org/mailman/listinfo/python-list

Re: Counting nested loop iterations

2006-03-16 Thread Caleb Hattingh
Hi Derek I went for an embarrassingly long time without knowing about "enumerate()". It doesn't directly answer your question about counting *within* nests, but I am going to tell you this on the off chance you don't know yet (and apologies if you do): This: count = 0 for animal in zoo: a =

Binary python extensions with Free Pascal Compiler

2006-03-16 Thread Caleb Hattingh
Hi all I want to write python extensions with FPC (Free Pascal Compiler, http://www.freepascal.org). In Delphi, this is trivially easy due to the great work of the P4D (Python-for-Delphi, http://mmm-experts.com/) guys; however, when aiming for cross-platform binary extensions, that strategy nat

Re: Counting nested loop iterations

2006-03-16 Thread Derek Basch
> Depending on the types of the containers in question, you could use: > > len(zoo) * len(animal) I think this would give me the total iterations but I wouldn't be able to get a running count. Correct? Thanks for the reply, Derek Basch -- http://mail.python.org/mailman/listinfo/python-lis

Re: accessing attributes when inheriting?

2006-03-16 Thread James Stroud
Peter J. Bismuti wrote: > > How do you access attributes of a class when inheriting from it? Can't you > just say: > > self.attribute? > > Help?! > ... > #!/usr/bin/python > > from Dialog impo

Re: Counting nested loop iterations

2006-03-16 Thread Derek Basch
Fredrik Lundh wrote: > what's kludgy with using a counter to count things ? Ohhh, nothing in particular. Just seeing if there is a better way to do it. > (the real question here is of course why you need the counter. what's > the loop doing? if the code you posted is all you have, you can rep

Re: Counting nested loop iterations

2006-03-16 Thread Jeffrey Schwab
Derek Basch wrote: > What is the best way to count nested loop iterations? I can only figure > to use an index but that seems kludgy. > > index = 0 > for animal in zoo: > for color in animal: > index += 1 Depending on the types of the containers in question, you could use: le

accessing attributes when inheriting?

2006-03-16 Thread Peter J. Bismuti
How do you access attributes of a class when inheriting from it? Can't you just say: self.attribute? Help?! ... #!/usr/bin/python from Dialog import Dialog import enscmd class RatDialog(Dial

accessing attributes when inheriting?

2006-03-16 Thread Peter Bismuti
How do you access attributes of a class when inheriting from it? Can't you just say: self.attribute?  Help?! ... #!/usr/bin/python from Dialog import Dialog import enscmd class RatDialog(Dialog

Re: Counting nested loop iterations

2006-03-16 Thread Fredrik Lundh
Derek Basch wrote: > What is the best way to count nested loop iterations? I can only figure > to use an index but that seems kludgy. > > index = 0 > for animal in zoo: > for color in animal: > index += 1 what's kludgy with using a counter to count things ? (the real question here is

Re: OCR question

2006-03-16 Thread Duncan Watson <[EMAIL PROTECTED]>
Excellent suggestion. I found it. I will see what I can do about some edge detection to crop the images so that gocr has an easier time of it. Thanks -Duncan -- http://mail.python.org/mailman/listinfo/python-list

Python / glade fundamentals

2006-03-16 Thread Doug
Hi all, Can someone tell me why I do not get a connection between the events and the functions in the sample below. GUI window appears OK, just no connections seem to be made. I am new to this so may be missing something fundamental. Thanks, Doug file pgtest.glade = http://

Counting nested loop iterations

2006-03-16 Thread Derek Basch
What is the best way to count nested loop iterations? I can only figure to use an index but that seems kludgy. index = 0 for animal in zoo: for color in animal: index += 1 Thanks, Derek Basch -- http://mail.python.org/mailman/listinfo/python-list

Re: Cheese Shop -> BSOL?

2006-03-16 Thread Christos Georgiou
On 11 Mar 2006 03:22:42 -0800, rumours say that "Paul Boddie" <[EMAIL PROTECTED]> might have written: >Tim Churches wrote: >> Would it be possible to rename "Cheese Shop" as "Bright Side of Life"? [Paul] >So should a service for finding Python packages have a distinct >identity? It is possible

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread [EMAIL PROTECTED]
What I have in mind is the efficient, generation of the complement S^n/WC(S^n). A good program should initialize, generate, and terminate. T=cartprodex(S,n,WC); //initialize for all i in T do what you want with i test to see if any more terminate if not and it should do this without explic

Re: Executing a DOS program from within Python

2006-03-16 Thread iapain
Use os.system and if you wanna get rid of console window use subprocess as gary said, you could have better options like killing proc if it hang/stuck using win32api (if you are using windows) else process timeout. ret = os.system('sample.exe') # ret will have return code and os.system execute sam

Re: Cheese Shop: some history for the new-comers

2006-03-16 Thread Fredrik Lundh
Paul Boddie wrote: > > one of the richest people on earth did define what developers are: > > > > http://www.ntk.net/ballmer/mirrors.html > > I was wondering when someone would mention the "developers, developers, > developers" Ballmer song-and-dance incident: clearly, he isn't chanting > about in

Re: email package 4.0a2

2006-03-16 Thread Tony Meyer
[Barry Warsaw] >> I'm happy to announce the release of the email 4.0a2 standalone >> package. [Konrad Hinsen] > My interpretation of the above paragraph is that it will be > impossible to write Python code using the email module (and possibly > other evolving modules) that works with both Python 2

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread Wade Humeniuk
Without much testing. Common Lisp Pattern exclusions are made lispy. (defun all-lists (list length) (unless (zerop length) (if (= length 1) (mapcar #'list list) (loop for elt in list nconc (mapcar (lambda (rest) (cons elt rest))

Re: Is Forth for real?

2006-03-16 Thread astrobe
[EMAIL PROTECTED] a écrit : > rickman wrote: > > The original post seems to be missing, but my answer to the title > > question is, No, Forth is not real. > > Not for real, for Integer. No, it's for me and you (well, perhaps more for you than for me). But 4IM is forever mine :) Amicalement,

Re: Cheese Shop: some history for the new-comers

2006-03-16 Thread Paul Boddie
Harald Armin Massa wrote: > > one of the richest people on earth did define what developers are: > > http://www.ntk.net/ballmer/mirrors.html I was wondering when someone would mention the "developers, developers, developers" Ballmer song-and-dance incident: clearly, he isn't chanting about intern

Re: Queue limitations?

2006-03-16 Thread mateom
I am creating the images by reading from texture memory using glGetTexImage(). As an experiment, I tried calling glGetTexImage() only once and letting imagQueue use that same reference over and over, but the images were all the same. So, this leads me to believe that the references returned by glG

Re: Xah's Edu Corner: The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations

2006-03-16 Thread Roedy Green
On 15 Mar 2006 22:20:52 -0800, "Xah Lee" <[EMAIL PROTECTED]> wrote, quoted or indirectly quoted someone who said : >e. For example, the in-fix >notation =E2=80=9C(3+(2*5))>7=E2=80=9D is written as =E2=80=9C3 2 5 * + 7 >= >=E2=80=9D, where the Not that Mr. Lee has ever shown much interest in feedb

Re: "pow" (power) function

2006-03-16 Thread Mike Ressler
On Wed, 2006-03-15 at 18:46 -0800, Ben Cartwright wrote: > Anyway, if you want to see the int vs. float issue in action, try this: > > >>> from timeit import Timer > >>> Timer('2**2').timeit() > 0.12681011582321844 > >>> Timer('2.0**2.0').timeit() > 0.6011743438121 > >>> Timer('2.

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: > There are many sites > dedicated to reasonably objective comparisons between languages. Here > are two examples: > > http://www.smallscript.org/Language%20Comparison%20Chart.asp > http://www.jvoegele.com/software/langcomp.html http://shootout.alioth.debian.org/ -

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread [EMAIL PROTECTED]
The point is to submit elegant code that showcases the features of each language. And the problem is, just to clarify, given a set WC of wildcards in any logical combination, and if WC(S^n) is the set all s in S^n that matches the wildcards, then efficiently generate the complement S^n\WC(S^n). You

Re: Large algorithm issue -- 5x5 grid, need to fit 5 queens plus some squares

2006-03-16 Thread Felipe Almeida Lessa
Em Qui, 2006-03-16 às 09:20 +0100, Fredrik Lundh escreveu: > when you're done with your homework (?), you can compare it with > Guido's solution: > > http://svn.python.org/view/python/trunk/Demo/scripts/queens.py Just a curiosity. Running the script as the site lists on my computer: $ time p

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread [EMAIL PROTECTED]
Flame war? Absolutely not. My reason is to learn. There are many sites dedicated to reasonably objective comparisons between languages. Here are two examples: http://www.smallscript.org/Language%20Comparison%20Chart.asp http://www.jvoegele.com/software/langcomp.html The wildcard exclusion problem

Re: Cheese Shop: some history for the new-comers

2006-03-16 Thread Harald Armin Massa
Tim, > For most people 'developers' would mean people developing *with* python, > not developing python. one of the richest people on earth did define what developers are: http://www.ntk.net/ballmer/mirrors.html people developing with something. So, unless we get /F or BDFL to do an even more a

Re: Executing a DOS program from within Python

2006-03-16 Thread Gary Herron
Randy Kreuziger wrote: >This is probably a newbie question but I need a kick start to get going. > >I need to run a DOS (sdetable) program from within a Python program. I'll use >command line switches so I will not need to interact with the program however >it would be nice if I could capture

Re: email package 4.0a2

2006-03-16 Thread Konrad Hinsen
On Mar 5, 2006, at 22:10, Barry Warsaw wrote: > I'm happy to announce the release of the email 4.0a2 standalone > package. > This is the latest version of the email package and will be released > with Python 2.5. The major changes between this version and email 3.0 > (released with Python 2.4)

Re: Large algorithm issue -- 5x5 grid, need to fit 5 queens plus some squares

2006-03-16 Thread [EMAIL PROTECTED]
Thank you very much guys! Just for clarification it wasn't homework, just extra credit :) I can't beleive I didn't realize that I didn't clear the GLOBAL variable :D -- http://mail.python.org/mailman/listinfo/python-list

Re: what's going on here?

2006-03-16 Thread John Salerno
Felipe Almeida Lessa wrote: > # Suppose line is "200412 34.235.233.2" > # for our comments > > # Creates a list, like ["2004", "12", "34.2", "35.2", "33.2"] > splitted = line.split() Thanks guys! I think what I forgot was that split() returns a list, so that's when the 'rows'

Executing a DOS program from within Python

2006-03-16 Thread Randy Kreuziger
This is probably a newbie question but I need a kick start to get going. I need to run a DOS (sdetable) program from within a Python program. I'll use command line switches so I will not need to interact with the program however it would be nice if I could capture its exit code. Thanks Rand

Re: what's going on here?

2006-03-16 Thread Felipe Almeida Lessa
Em Qui, 2006-03-16 às 16:31 +, John Salerno escreveu: > So finally here's my question: If you are using data.append(), doesn't > that just put all the numbers into one long list? How are the tuples > still being created in this case so that the list comprehensions still > work? It seems like

Re: what's going on here?

2006-03-16 Thread Schüle Daniel
[...] > So finally here's my question: If you are using data.append(), doesn't > that just put all the numbers into one long list? no, append appends extend does what you think How are the tuples > still being created in this case so that the list comprehensions still > work? It seems like th

Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-16 Thread john_sips_tea
Jason Earl wrote: > "msoulier" <[EMAIL PROTECTED]> writes: > > >> I have found the Python sidebar VERY helpful: > > > > Personally, I can't use local docs on my desktop as they may not be > > the same version of the docs for the Python distro running on the > > server that I'm deploying on. I usua

what's going on here?

2006-03-16 Thread John Salerno
This might be confusing to explain, because it's a question about an example in Beginning Python and I'll try to provide all the info I can. First off, I'm reading a chapter on using the ReportLab modules to create a line graph from a set of data. The first implementation of the program uses a

Re: python2.4.2 + win95, import socket dll error

2006-03-16 Thread John Pote
Dennis, Thanks for the info. Found winsock2.0 on the MS knowledge base site. Downloaded, installed (with the y2k upgrade as recommended) and, amazingly, all is working. My simple socket server works no problem as does a test http client sending data to my web site. This latter program seems a li

Re: Computing correlations with SciPy

2006-03-16 Thread John Hunter
> "tkpmep" == tkpmep <[EMAIL PROTECTED]> writes: tkpmep> I want to compute the correlation between two sequences X tkpmep> and Y, and tried using SciPy to do so without success.l tkpmep> Here's what I have, how can I correct it? X = [1, 2, 3, 4, 5] Y = [5, 4, 3, 2, 1] im

Re: can't send large messages over SSL socket

2006-03-16 Thread [EMAIL PROTECTED]
Well the first thing to note is that the maximum record length in SSL is exactly 16384. SSL/TLS does not preserve message boundaries - it is up to the application to determine if there are multiple messages in a single record, or a single message spanning multiple records. Sounds like the particu

Re: Python Documentation Standards

2006-03-16 Thread Duncan Booth
Steven Bethard wrote: > Colin J. Williams wrote: >> Doc strings provide us with a great opportunity to illuminate our code. >> >> In the example below, __init__ refers us to the class's documentation, >> but the class doc doesn't help much. > > It doesn't? > > >>> print list.__doc__ > list() ->

  1   2   >