Re: Bringing Order to programming

2019-01-31 Thread Ben Bacarisse
> transcript > > a 0.0680 s, a 1.2040 s, a 9.5823 s, a 81.9688 s, My times are very nearly linear: a 0.0280 s, a 0.2931 s, a 2.9006 s, a 29.4318 s, -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Loop with else clause

2019-02-05 Thread Ben Finney
assumes some other code has decided which items to handle; it becomes correspondingly simpler. -- \ “Two possibilities exist: Either we are alone in the Universe | `\ or we are not. Both are equally terrifying.” —Arthur C. Clarke, | _o__)

Re: The sum of ten numbers inserted from the user

2019-02-07 Thread Ben Bacarisse
; print('that is not a number, try again') > else: > numbers.append(chip) > > print(sum(numbers)) Why would you not keep a running total, rather than list of the numbers? I've not been following assiduously, so maybe I missed some other requirement... -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: The sum of ten numbers inserted from the user

2019-02-07 Thread Ben Bacarisse
Bart writes: > On 07/02/2019 20:45, Ben Bacarisse wrote: >> Ian Clark writes: >> >>> This is my whack at it, I can't wait to hear about it being the wrong big o >>> notation! >>> >>> numbers=[] >>> >>> while len(numbers)

Re: The sum of ten numbers inserted from the user

2019-02-07 Thread Ben Bacarisse
Grant Edwards writes: > On 2019-02-07, Ben Bacarisse wrote: >> Ian Clark writes: >> >>> This is my whack at it, I can't wait to hear about it being the wrong big o >>> notation! >>> >>> numbers=[] >>> >>> while len

Re: Can't run setup.py offline due to setup_requires - setup.py calls home

2019-02-11 Thread Ben Finney
eve that they own culture, they are so | _o__) self-righteous about it …” —Nina Paley, 2011 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem : Generator

2019-02-14 Thread Ben Finney
to information. They are the tool of choice for the internet | _o__) highwayman.” —Anthony Taylor | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: New rules for scope in a function?

2019-02-18 Thread Ben Bacarisse
quot; + x + " y = "+ y) f(x) print("x = " + x) The material I cut did include the explanation so go back and read the message you replied to here if you don't follow. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: The NaNny State

2019-02-18 Thread Ben Finney
n't know what it | `\is. Every once in a while I'll be listening to the radio and I | _o__)say, ‘I think I might have written that.’” —Steven Wright | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: What's the address for?

2019-02-18 Thread Ben Finney
t containers, and thinking of them that way will frequently lead you to the wrong conclusion. https://nedbatchelder.com/text/names1.html> -- \ “Theology is the effort to explain the unknowable in terms of | `\ the not worth knowing.” —Henry L. Mencken | _o__)

Re: Multiprocessing performance question

2019-02-18 Thread Ben Finney
e you tried using that library and timing the result? -- \ “You don't need a book of any description to help you have some | `\kind of moral awareness.” —Dr. Francesca Stavrakoloulou, bible | _o__) scholar, 2011-05-08 | Ben Finney -- http

Re: Feature suggestions: "Using declarations" i.e. context managers ("with" blocks) tied to scope/lifetime of the variable rather than to nesting

2019-02-19 Thread Ben Finney
purpose:: with foo.open() as logfile: frobnicate_the_whelk(logfile=logfile) -- \ “I don't want to live peacefully with difficult realities, and | `\ I see no virtue in savoring excuses for avoiding a search for | _o__) real answers.” —Pau

Re: Two Tier Cloud Network

2019-02-25 Thread Ben Finney
is to the | _o__) culinary arts.” —Michael Bacarella | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Totally Legit Signing Key?

2019-03-04 Thread Ben Finney
ovenance of the key that made the signature. -- \“Human reason is snatching everything to itself, leaving | `\ nothing for faith.” —Bernard of Clairvaux, 1090–1153 CE | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Not a python question, just programming logic trap?

2019-03-13 Thread Ben Finney
ne by children. | `\ They had all the paintings up on refrigerators.” —Steven Wright | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Reasoning of calling a method on class object instead of class instance object

2019-03-18 Thread Ben Finney
sier when the RefrigeratedShippingContainer encapsulates the conversions of temperature units. -- \ “When we pray to God we must be seeking nothing — nothing.” | `\—Francis of Assisi | _o__)

Re: Reasoning of calling a method on class object instead of class instance object

2019-03-18 Thread Ben Finney
Arup Rakshit writes: Michael Torrie writes: > On 03/18/2019 05:55 PM, Ben Finney wrote: > >> If I call `_c_to_f`, `_f_to_c` methods on `self` instead of > >> `RefrigeratedShippingContainer` class object, still it works. > > > > That's right, and is inde

Re: Your IDE's?

2019-03-25 Thread Ben Finney
ex tasks we expect of a programmer's editor like Vim or GNU Emacs. -- \“The reason we come up with new versions is not to fix bugs. | `\ It's absolutely not.” —Bill Gates, 1995-10-23 | _o__)

Re: Your IDE's?

2019-03-27 Thread Ben Finney
is not ignorance but the illusion of | _o__)knowledge.” —Daniel J. Boorstin, historian, 1914–2004 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: configparser - which one?

2019-03-27 Thread Ben Finney
`\ approaches zero. All non-Free software is a dead end.” —Mark | _o__) Pilgrim, 2006 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-03-27 Thread Ben Finney
ssed before? Too many times to count :-) -- \ “Theology is the effort to explain the unknowable in terms of | `\ the not worth knowing.” —Henry L. Mencken | _o__) | Ben Finney -- https://mail.p

Re: formatted docstrings

2019-04-03 Thread Ben Finney
x27;s going to change depending on the environment). -- \ “Courage is not the absence of fear, but the decision that | `\ something else is more important than fear.” —Ambrose Redmoon | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Logging cf Reporting = Friday Filosofical Finking

2019-04-05 Thread Ben Coleman
wants changes what he wants. Ben -- Ben Coleman olo...@benshome.net | For the wise man, doing right trumps http://oloryn.benshome.net/ | looking right. For the fool, looking Amateur Radio NJ8J | right trumps doing right. signature.asc Description: OpenPGP digita

Re: Design a function that finds all positive numbers

2019-04-09 Thread Ben Bacarisse
s what to do with duplicates. The question should be worded so that it's either clear what is wanted, or so that it is clear that you should decide what to do. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Design a function that finds all positive numbers

2019-04-09 Thread Ben Bacarisse
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Ben Bacarisse writes: >>Ranjith Bantu writes: >>>can I solve any problems like this by learning python? >>You need to learn how to solve problems as well as learning Python -- > > I do not separate "solv

Re: Function to determine list max without itertools

2019-04-19 Thread Ben Bacarisse
r? > PS Since I am going through the list fully the only optimisation I can > think of a generator to feed it seems sort of redundant. Unless of > course it was a list of 10,000 numbers then maybe its useful. I'm not sure what was meant here. I can think of one micro-optimisation but I'd want to test to see if really makes and difference. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Is this a "gotcha" in Python?

2019-04-20 Thread Ben Bacarisse
d, of course, be loads of /other/ things that would be potential "gotcha"s.) -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Help? How do i solve this problem with Python List Concept

2019-05-11 Thread Ben Bacarisse
you need to know at least one actual age, rather than just the age gaps. Maybe the exercise is to write a function that takes the age of, say, the youngest child and then calculates the inheritances? Anyway, your starting point will be to work through an example on paper so you are clear abo

Re: Testing the data type of a value

2019-05-12 Thread Ben Bacarisse
uot;: > print("Integer") > > Why isn't this working? Advance thanks for your time. See if this helps... >>> type(5) >>> type(type(5)) >>> type("") so you are comparing two things with different types. An analogous situation w

Re: convert .py to Android ?

2019-05-14 Thread Ben Finney
imity | `\of the graveyard.” —Justice Roberts in 319 U.S. 624 (1943) | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Instance vs Class variable oddity

2019-05-15 Thread Ben Finney
;s no music, no | `\ choreography, and the dancers hit each other.” —Jack Handey | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: repr = expression representation?

2019-05-17 Thread Ben Bacarisse
ry limited way, fudge it like this: def myrepr(e): if isinstance(e, types.BuiltinFunctionType): return e.__name__ return repr(e) The trouble is that print does not always mean print because that identifier can be rebound. Python could try to provide some /other/ name for every object, one that can't be rebound (something like an environment + string lookup) but it's probably not worth it. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: How Do You Replace Variables With Their Values?

2019-07-10 Thread Ben Finney
do you need to also have them bound to separate names; what problem are you trying to solve that you think this will help? -- \ “If [a technology company] has confidence in their future | `\ ability to innovate, the importance they place on protecting | _o__) their pas

Re: How Do You Replace Variables With Their Values?

2019-07-11 Thread Ben Finney
'Banana Split'] The above code produces this output, without any need for binding new names. So what is it you are actually trying to achieve, and why do you think the new bindings are necessary? -- \“The number of UNIX installations has grown to 10, with more | `\ expected.” —Unix Programmer's Manual, 2nd Ed., 1972-06-12 | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: join and split with empty delimiter

2019-07-18 Thread Ben Bacarisse
, 'b', 'c', 'd'] > > But my question is: Is there any good reason why the split function > should give an "empty separator" error? I think the meaning of trying > to split a string into a list using the empty string as a delimiter is > unambi

Re: join and split with empty delimiter

2019-07-18 Thread Ben Bacarisse
Danilo Coccia writes: > Il 18/07/2019 12:27, Ben Bacarisse ha scritto: >> Irv Kalb writes: >> >>> I have always thought that split and join are opposite functions. For >>> example, you can use a comma as a delimiter: >>> >>>>>> m

Re: How to convert the following IDL program lines to equivalent Python program lines?

2019-11-28 Thread Ben Bacarisse
is duplicated in IDL? If the second one were not there, this: JMP: IF WK(L-1,K-1) EQ 0 THEN BEGIN L=L+1 GOTO, JMP ENDIF would just be a while loop: while WK[L-1,K-1] == 0: L=L+1 By the way, all those -1s suggest that the IDL was itself a translation from a language with 1-based array indexing. All that might be able to be tidied up. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Extract all words between two keywords in .txt file (Python)

2019-12-11 Thread Ben Bacarisse
OC SQL;', '')] Your main issue is that | binds weakly. Your whole pattern tries to match any one of just four short sub-patterns: PROC SQL; proc sql;(.*?)RUN; quit; QUIT; -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Extract all words between two keywords in .txt file (Python)

2019-12-12 Thread Ben Bacarisse
A S writes: > On Thursday, 12 December 2019 02:28:09 UTC+8, Ben Bacarisse wrote: >> A S writes: >> >> > I would like to extract all words within specific keywords in a .txt >> > file. For the keywords, there is a starting keyword of "PROC SQL;" (I

urllib unqoute providing string mismatch between string found using os.walk (Python3)

2019-12-21 Thread Ben Hearn
J.Staaf - ¡Móchate! _PromoMix_.wav ? ^ What am I missing when it comes to unquoting the string, or should I do some other fancy operation on the drive string? Cheers, Ben -- https://mail.python.org/mailman/listinfo/python-list

Re: urllib unqoute providing string mismatch between string found using os.walk (Python3)

2019-12-22 Thread Ben Hearn
On Saturday, 21 December 2019 21:46:43 UTC, Ben Hearn wrote: > Hello all, > > I am having a bit of trouble with a string mismatch operation in my tool I am > writing. > > I am comparing a database collection or url quoted paths to the paths on the > users drive. &g

Re: ÿ in Unicode

2020-03-05 Thread Ben Bacarisse
moi writes: >>>> 'ÿ'.encode('utf-8') > b'\xc3\xbf' >>>> 'ÿ'.encode('utf-16-le') > b'\xff\x00' >>>> 'ÿ'.encode('utf-32-le') > b'\xff\x00\x00\x00' That all lo

Re: ÿ in Unicode

2020-03-06 Thread Ben Bacarisse
moi writes: > Le jeudi 5 mars 2020 13:20:38 UTC+1, Ben Bacarisse a écrit : >> moi writes: >> >> >>>> 'ÿ'.encode('utf-8') >> > b'\xc3\xbf' >> >>>> 'ÿ'.encode('utf-16-le') >> >

Re: ÿ in Unicode

2020-03-06 Thread Ben Bacarisse
moi writes: > Le jeudi 5 mars 2020 13:20:38 UTC+1, Ben Bacarisse a écrit : >> moi writes: >> >> >>>> 'ÿ'.encode('utf-8') >> > b'\xc3\xbf' >> >>>> 'ÿ'.encode('utf-16-le') >> >

Re: ÿ in Unicode

2020-03-06 Thread Ben Bacarisse
moi writes: > Le jeudi 5 mars 2020 13:20:38 UTC+1, Ben Bacarisse a ÄCcrit : >> moi writes: >> >> >>>> 'Ä¿'.encode('utf-8') >> > b'\xc3\xbf' >> >>>> 'Ä¿'.encode('utf-16-le') >&g

Re: ÿ in Unicode

2020-03-07 Thread Ben Bacarisse
uage will > start to work properly. >>> "ÿ".encode('iso-8859-1') b'\xff' -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Fwd: installed but doesn't boot

2020-05-23 Thread Ben Hansen
-- Forwarded message - From: Ben Hansen Date: Sat, May 23, 2020 at 11:44 AM Subject: Fwd: installed but doesn't boot To: -- Forwarded message - From: Ben Hansen Date: Fri, May 22, 2020 at 3:18 PM Subject: installed but doesn't boot To: I have

Re: Behaviour of os.path.join

2020-05-26 Thread Ben Bacarisse
;t know your intent is far as defaults go.) > The documentation says that an absolute path in the parameter list for > join will discard all previous parameters but '\\' is not an absoute > path! I think it is. The picture is messy on Windows (because of the drive letter) but

Re: Behaviour of os.path.join

2020-05-27 Thread Ben Bacarisse
. If c:\x\y is a file, calling it c:\x\y\ won't change that, but it might give you an error when you try to access it. That may be what you want. If so, appending '.' is likely to be more portable. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Behaviour of os.path.join

2020-05-27 Thread Ben Bacarisse
BlindAnagram writes: > On 27/05/2020 13:30, Ben Bacarisse wrote: >> BlindAnagram writes: >> >>> The issue that I raised here was whether the behaviour of os.path.join() >>> in treating the Windows directory separator '\\' as an absolute path >>

Re: Behaviour of os.path.join

2020-05-27 Thread Ben Bacarisse
BlindAnagram writes: > On 27/05/2020 16:53, Ben Bacarisse wrote: >> As it should. Relying on a trailing \ having the right effect is >> brittle to say the least. > > In my case less brittle than leaving it out. Brittle does not mean broken. I know you can fix it by mak

Re: Behaviour of os.path.join

2020-05-27 Thread Ben Bacarisse
Roel Schroeven writes: > Ben Bacarisse schreef op 27/05/2020 om 17:53: >> There is well-known (*nix) software that relies on a/b/c/ meaning >> something different to a/b/c but I don't know anyone who thinks this is >> a good idea. It causes no end of confusion. > &

Re: Didn't understand the output of the following Python 3 code with reduce function?

2020-08-28 Thread Ben Bacarisse
t(add) > > output: 9 Hint: reduce(f, [e1, e2]) is f(e1, e2) reduce(f, [e1, e2, e3]) is f(f(e1, e2), e3) reduce(f, [e1, e2, e3, e4]) is f(f(f(e1, e2), e3), e4) Replace f with a function that adds one to its first argument. Does that help? -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: musings on static variables

2020-09-16 Thread Ben Bacarisse
gt; > transcript > > 0 > 1 > 2 def f(i = [0]): i[0] += 1 return i[0] print(f()) print(f()) print(f()) maybe? More than a bit yucky, though. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Find word by given characters

2020-11-03 Thread Ben Bacarisse
u could even make a single pattern like this: (?=.*t.*t)(?=.*a) While there are probably better ways in Python, this is what I'd do on the command line. For example $ grep -P '(?=.*t.*t)(?=.*a)' word-list | wc -l 45677 $ grep 't.*t' word-list | grep a | wc -l 45677 -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Reply-To header

2005-10-03 Thread Ben Finney
se: to give the return address for an individual reply to the message author. -- \ "What I resent is that the range of your vision should be the | `\ limit of my action." -- Henry James | _o__)

Re: Pygame: Filling the screen with tile images

2005-10-05 Thread Ben Sizer
the background image and blit that to the screen at the start of every frame you draw. -- Ben Sizer -- http://mail.python.org/mailman/listinfo/python-list

Re: bug or feature?

2005-10-05 Thread Ben Sizer
le who really do want that behaviour, working around the warning should involve minimal extra code, with extra clarity thrown in for free. -- Ben Sizer -- http://mail.python.org/mailman/listinfo/python-list

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Ben Sizer
grammer will have to take these considerations on board when writing their code, whether we want to use them or not. -- Ben Sizer -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-10-16 Thread Ben Pfaff
Roedy Green <[EMAIL PROTECTED]> writes: > End users HATE PDF. Why? > > It takes so long for the reader to load. xpdf comes up almost instantly here. Maybe end users should consider finding a better PDF reader. -- "Your correction is 100% correct and 0% helpful. Well done!" --Richard Heathfield

Re: Sequence and/or pattern matching

2005-10-19 Thread Ben Sizer
if you need to represent bidirectional connections. Then you can perform search on that as required. The only slight complication is avoiding infinite loops - I might use a dictionary of address->boolean values here and check off each address as the algorithm progresses. -- Ben Sizer -- http://mail.python.org/mailman/listinfo/python-list

Re: Upgrading 2.4.1 to 2.4.2

2005-10-19 Thread Ben Sizer
it's possible to do this with just 1 symbolic link somewhere. -- Ben Sizer -- http://mail.python.org/mailman/listinfo/python-list

Re: How to extract a part of html file

2005-10-19 Thread Ben Finney
t would be a good idea." -- Mahatma Gandhi (when | `\asked what he thought of Western civilization) | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Minimizing Connection reset by peer exceptions

2005-10-20 Thread Ben Sizer
being unplugged, or a timeout along the way, etc. 5% is a high figure, but perhaps you connect to hosts that are unreliable for some reason. You don't have control over this really; just make sure you handle the exception. Such is life, when dealing with networking. -- Ben Sizer -- htt

Re: Minimizing Connection reset by peer exceptions

2005-10-20 Thread Ben Sizer
e original poster seemed to be a client (using connect_ex) rather than a server, so I think this would only be an issue if the code was connecting to the same host repeatedly in quick succession. -- Ben Sizer -- http://mail.python.org/mailman/listinfo/python-list

Re: select.select() on windows

2005-10-26 Thread Ben Sizer
n the main thread. You could perhaps use an Event object here, which has the time-out functionality for you. -- Ben Sizer -- http://mail.python.org/mailman/listinfo/python-list

Re: loop help

2005-10-27 Thread Ben Sizer
here's little Python can do about it. ;) Which part of the code issues the overflow error? I'm guessing it's the draw.point() call since that's the only bit I can't test. -- Ben Sizer -- http://mail.python.org/mailman/listinfo/python-list

Help: Quick way to test if value lies within a list of lists of ranges?

2005-10-27 Thread Ben O'Steen
way to do this? I don't like the idea of looping through 100+ sprites and test them each an arbitary number of times every update. Is this just something unavoidable which should be written in C for speed and included with SWIG or something similar? Ben (Anti-Zealotry ward) :0: * ^Subject:.*Re

Re: Opaque documentation

2005-10-28 Thread Ben Sizer
em with Python and its libraries, sadly. The same almost certainly goes for most open source projects. -- Ben Sizer -- http://mail.python.org/mailman/listinfo/python-list

Rich __repr__

2005-10-30 Thread Ben Finney
x." -- Gore Vidal | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Rich __repr__

2005-10-30 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> wrote: > If I want to implement a __repr__ that's reasonably "nice" to the > programmer, what's the Right Way? Are there recipes I should look > at? As a (carefully selected) example from the code I'm writing:

Re: Why the nonsense number appears?

2005-10-31 Thread Ben O'Steen
;>> t2 += 12345678910 >>> # Note, both t1 and t2 have been incremented by the same amount. >>> print t1-t2 0.0389995574951 It appears Yu-Xi Lim beat me to the punch. Using decimal as opposed to float sorts out this error as floats are not built to handle the size of number used here. Ben -- http://mail.python.org/mailman/listinfo/python-list

Re: Why the nonsense number appears?

2005-10-31 Thread Ben O'Steen
On Mon, October 31, 2005 10:23, Sybren Stuvel said: > Ben O'Steen enlightened us with: >> Using decimal as opposed to float sorts out this error as floats are >> not built to handle the size of number used here. > > They can handle the size just fine. What they can't

Re: Automatically creating a HOME environ variable on Windows?

2005-11-01 Thread Ben Sizer
fixed for the next version. -- Ben Sizer. -- http://mail.python.org/mailman/listinfo/python-list

Re: Rich __repr__

2005-11-01 Thread Ben Finney
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, Ben Finney wrote: > > > class Human_Sex(str): > > def __repr__(self): > > repr_str = "%s(name=%s)" % ( > >

Re: Rich __repr__

2005-11-01 Thread Ben Finney
Erik Max Francis <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > If I want to implement a __repr__ that's reasonably "nice" to the > > programmer, what's the Right Way? Are there recipes I should look > > at? > > I tend to use: > >

Re: Python's website does a great disservice to the language

2005-11-02 Thread Ben Sizer
ot possibly suit everybody? You can append "body { font-family: sans-serif; font-size: 10pt; }" to the CSS and make it look 'professional' but it doesn't make it more readable. Really this just comes down to preconceptions over how a site 'should' look based on ot

Re: Python's website does a great disservice to the language

2005-11-02 Thread Ben Sizer
Björn Lindström wrote: > Actually it does set some fonts ("avantgarde" and > "lucidasomethignorother") as first choices. I guess you, like me, and > probably most people in here, doesn't have those installed. As far as I can tell, those fonts are only set for

Re: computer programming

2005-11-03 Thread Ben Finney
ing in life is so exhilarating as to be shot at without | `\result." -- Winston Churchill | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

ADT for restricted set of values

2005-11-03 Thread Ben Finney
e way to do what I'm describing? Am I missing a common programming pattern? -- \ "I bought a self learning record to learn Spanish. I turned it | `\on and went to sleep; the record got stuck. The next day I | _o__)could only stutter in Spanish." -- Steven Wright | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: help converting some perl code to python

2005-11-04 Thread Ben Sizer
[EMAIL PROTECTED] wrote: > the problem is the '..' operator in perl. Is there any equivalent in > python? I can't think of anything with a similar operation, to be honest. I'd try using while loops which look out for the next section delimiter. -- Ben Sizer. -- http

Re: Most efficient way of storing 1024*1024 bits

2005-11-04 Thread Ben Sizer
rators on an array of bytes: > > Actually, no, it's to xor all the bits together and store them in a single > boolean. I'd use 'or' rather than 'xor'. The or operator is more likely to yield a '1' at the end of it, and a 1 is narrower than a 0, o

Re: how to present Python's OO feature in design?

2005-11-07 Thread Ben Sizer
ot of refactoring later, but in Python this is rarely a difficult task. -- Ben Sizer -- http://mail.python.org/mailman/listinfo/python-list

Re: Is mod_python 3.1 good for commercial blogging/CMS?

2005-11-08 Thread Ben Sizer
. Are my assumptions > correct, or am I falling prey to FUD? Python is a good language for rapid development and hence testing. So you could probably create a quick mock-up of your system and then write some scripts to place it under heavy stress to see how well it holds up. -- Ben Sizer -- http://mail.python.org/mailman/listinfo/python-list

Re: Python obfuscation

2005-11-10 Thread Ben Sizer
e many reasons that make webservices the way > of the future (hey, even *MSFT* noticed that recently, it seems...). But they are not suitable for all applications, and probably never will be. -- Ben Sizer -- http://mail.python.org/mailman/listinfo/python-list

Re: derived / base class name conflicts

2005-11-10 Thread Ben Finney
se who dare not, are slaves." -- "Lord" George | _o__) Gordon Noel Byron | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Abstract Base Classes

2005-11-10 Thread Ben Finney
gs/viewpost.jsp?thread=92662> -- \ "The shortest distance between two points is under | `\ construction." -- Noelie Alito | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Abstract Base Classes

2005-11-10 Thread Ben Finney
value of nothing." -- Oscar Wilde | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: modify dictionary while iterating

2005-11-11 Thread Ben Finney
t;I know the guy who writes all those bumper stickers. He hates | `\ New York." -- Steven Wright | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Needed class whose instances are many test cases

2005-11-11 Thread Ben Finney
other enemas..." -- Emo Philips | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Python obfuscation

2005-11-11 Thread Ben Sizer
heard, even legal fees. I think that's a poor example - the cost hasn't come from the mere act of adding protection, but the method in which that protection operates. I don't think anybody here - certainly not me - is talking about infecting a user's system to protect our

Re: Python obfuscation

2005-11-11 Thread Ben Sizer
e, as Alex pointed out, all of these are just keeping honest > people honest. The crooks have all the advantages in this game, so you > really can't expect to win. No, certainly not. But if you can mitigate your losses easily enough - without infringing upon anyone else's rights, I must add - then why not do so. -- Ben Sizer. -- http://mail.python.org/mailman/listinfo/python-list

Re: Needed class whose instances are many test cases

2005-11-11 Thread Ben Finney
Roy Smith <[EMAIL PROTECTED]> wrote: > Ben Finney <[EMAIL PROTECTED]> wrote: > > Test cases should each run individually, from a known state, and > > not depend on any other tests. You can define a fixture for > > several tests in the unittest.TestCase metho

Re: Python obfuscation

2005-11-12 Thread Ben Finney
| _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal for adding symbols within Python

2005-11-12 Thread Ben Finney
states could be represented in the enumeration, and individual states compared to see if they are "later" that each other. If sequence was not considered important, of course, this feature would not get in the way. -- \ "I put instant coffee in a microwave oven and almost went

the button of cancel

2005-11-12 Thread Ben Bush
When I click the button of cancel, I got the follwoing message. I want to see "Goodbye" on the console screen.What to do?   Traceback (most recent call last):  File "C:\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript    exec codeObject in __main__.__dict

Re: triangulation

2005-11-12 Thread Ben Bush
Is there any pure python ocde there thoguh it is slow? Not many people know C very well and it will be great to have some python code even for education use. Ben   I know someone once mentioned that they tried writing one of theDelaunay triangulation algorithms in pure Python and abandoned it

circle and point

2005-11-12 Thread Ben Bush
is there any code to decide whether a point is located within the circle by three other points?Thanks!B. Bush -- http://mail.python.org/mailman/listinfo/python-list

Re: circle and point

2005-11-12 Thread Ben Bush
On 11/12/05, Robert Kern <[EMAIL PROTECTED]> wrote: Ben Bush wrote:> is there any code to decide whether a point is located within the circle> by three other points? # Converted from my C++ code.# C.f. http://www.ics.uci.edu/~eppstein/junkyard/circumcenter.htmldef circumc

Re: Proposal for adding symbols within Python

2005-11-13 Thread Ben Finney
Steven Wright | `\ | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list

<    7   8   9   10   11   12   13   14   15   16   >