Re: English-like Python

2009-01-21 Thread Scott David Daniels
quot;abc", 123)) Or would you require that tuple-formation is "special"? --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: is this pythonic?

2009-01-21 Thread Scott David Daniels
i+=1 Or the following: indices = [i for i,d in enumerate(l) if d['title']=='ti'] for i in reversed(indices): # so del doesn't affect later positions del l[i] --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Scott David Daniels
ar to commit is equivalent to an infinite loop for all applications that I have interacted with (and yes, I have worked allowing four day transactions to commit). --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: what gives with

2009-01-23 Thread Scott David Daniels
"backward compatible." --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a field to a 'foreign' object from the outside

2009-01-23 Thread Scott David Daniels
lder().method if you have no other use for the instance of your Holder instance. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: seeking to improve Python skills

2009-01-23 Thread Scott David Daniels
1.667) and, as they so often say, "lather, rinse, repeat." --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Two import questions in Python 3.0

2009-01-24 Thread Scott David Daniels
27;import from package.possible: %s' % __file__) __init__.py - print('package initialized: %s' % __file__) A.py -- print('A started: %s' % __file__) import possible print('A running: %s' % __file__) --Scott David Da

Re: Web authentication urllib2

2009-01-24 Thread Scott David Daniels
comp.lang.python for a while, you'll see this is the norm for messages here, and these behaviors help make this a more pleasant place to read and write. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: RegEx issues

2009-01-24 Thread Scott David Daniels
.", and examining the patters with print(somestring), you'll ease your life. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Newby: how to transform text into lines of text

2009-01-25 Thread Scott David Daniels
e strict and report the first line as "foo\n\n"; I was wrong. Here's how I'd do it: with open('deheap/deheap.py', 'rU') as source: for line in source: print line.rstrip() # Avoid trailing spaces as well. This should handle \n, \r

Re: A java hobbyist programmer learning python

2009-01-26 Thread Scott David Daniels
e seen looks like its fit will feel more like a suit of armor than a shirt. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: I'm a python addict !

2009-01-26 Thread Scott David Daniels
lled in data switched class, and invoked their corresponding method. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Counting number of objects

2009-01-27 Thread Scott David Daniels
n't remember the details, but I remember my work-around. If you do have troubles, try using almost the same code you now use, but substitute for the obvious lines above: d = weakref.WeakValueDictionary() and d[id(x)] = x --Scott David Daniels scott.dani...@acm.org -- http://mail.py

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-27 Thread Scott David Daniels
Paul Rubin wrote: Scott David Daniels writes: But, the research on the language "Self" shows that even in the face of a language with more dynamism than Smalltalk (or Python), performance can be obtained using compiler technology I'd be interested in seeing any publicat

Re: Why doesn't eval of generator expression work with locals?

2009-01-28 Thread Scott David Daniels
dle on it, otherwise it may get recycled and reused. That is, id(var1) == id(var2) implies var1 is var2, but id(expr1) == id(expr2) does not even imply expr1 == expr2 --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0, 'Hello' < 42

2009-01-28 Thread Scott David Daniels
e sort order is not a particularly useful one (except for the fact that there is an order). --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: search speed

2009-01-30 Thread Scott David Daniels
27; % (1 + n, line.rstrip()) Be careful with your assertion that a regex is faster, it is certainly not always true. Measure speed, don't take mantras as gospel. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a positive number and a negative number

2009-01-30 Thread Scott David Daniels
Grant Edwards wrote: On 2009-01-30, MRAB wrote: Eric Kang wrote: In two's complement representation, can adding one positive and one negative give you overflow? No. AFAIK, in Python adding integers never gives you overlow regardless of sign. Right, but he wants his homework answer. -- http

Re: relpath problem on windows

2009-01-30 Thread Scott David Daniels
27; What am I missing? There is no way to write a raw string for text ending in a single backslash. r'd:\\' == 'd:' What you want is relpath(r'd:\jho', 'd:\\') But it turns out this doesn't work, either. File a bug. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Number of bits/sizeof int

2009-01-30 Thread Scott David Daniels
stuck with. Well, what are your arg constraints? Integers in 0 .. 2**53? math.frexp(n)[1] --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do operators and methods of built-in types differ

2009-01-31 Thread Scott David Daniels
trickier than the above seems to show. Here is how to get the full behavior: >>> import operator >>> operator.add(1,[]) Traceback (most recent call last): File "", line 1, in operator.add(1,[]) TypeError: unsupported operand type(s) f

Re: Empty string is False right?

2009-01-31 Thread Scott David Daniels
or: main(sys.arg[1:] or ['default', 'args']) --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Combining several text files

2009-02-02 Thread Scott David Daniels
you may need to write it differently. You can use this as a source of lines for your parser. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Python package Management GUI - New Project on Sourceforge

2009-02-02 Thread Scott David Daniels
o No GUI toolkit would be available out of the box. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Unzipping a .zip properly, and from a remote URL

2009-02-03 Thread Scott David Daniels
handle.close() >>> archive = zipfile.ZipFile(zipdata) or: >>> with urllib2.urlopen("http://...file.zip";) as remotehandle: ...zipdata = StringIO.StringIO(remotehandle.read()) ...archive = zipfile.ZipFile(zipdata) --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: is python Object oriented??

2009-02-03 Thread Scott David Daniels
't followed for more than couple of decades. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Global State

2009-02-03 Thread Scott David Daniels
. Otherwise, the advice is spot-on. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Path question

2009-02-03 Thread Scott David Daniels
modules/application.py ... your import should work. You need to make the package layering to application explicit. Similarly, you can start Idle with: python -m idlelib.idle ... --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Load / Reload module

2009-02-04 Thread Scott David Daniels
Class() ... reload(classes) from classes import * instance = SomeClass() --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter

2009-02-04 Thread Scott David Daniels
ton(frame1,text='close',bg='light gray', command=on_click) close_frame1.pack_propagate(0) close_frame1.pack(side=TOP, anchor=N,pady=25) The "global" lines are needed so that on_click and MainWin (which both set the two names) are talking about the same objects. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.float_info.epsilon

2009-02-04 Thread Scott David Daniels
ng point behave a little bit like real numbers. The reason it is tough is that addition is not associative in real numbers, and associativity is at the core of a lot of proofs in arithmetic (and group theory). --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Upgrade 2.6 to 3.0

2009-02-04 Thread Scott David Daniels
ges. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.float_info.epsilon

2009-02-04 Thread Scott David Daniels
uot; as "mes in the first line quoted above). --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

More on ancient pythons (before version 0.0?)

2009-02-04 Thread Scott David Daniels
/7868588.stm I know, Titanoboa might not have actually been a python, but it may well have been a precursor to our Python. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: global name 'sqrt' is not defined

2009-02-05 Thread Scott David Daniels
ocuments describe their code without the module name. I believe that such behavior is because, when working to produce prose about a package, it feels too much like useless redundancy when describing each function or class as "package.name". --Scott David Daniels scott.dani...@acm.org

Re: What is difference between ADO and RDO

2009-02-06 Thread Scott David Daniels
OdarR wrote: On 6 fév, 10:56, Agile Consulting wrote: Explain ADO and RDO RU a bot ? I expect someone is experimenting with their spam generator. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python3.0 has more duplication in source code than Python2.5

2009-02-07 Thread Scott David Daniels
solutions to some problems as we switch to Unicode strings from byte strings. You are comparing a .0 version to .5 versions. I expect the polishing that follows as we go up through .1, .2, and so on will lower those redundancy measures. --Scott David Daniels scott.dani...@acm.org -- http://mail.p

Re: MacPython 2.5 IDLE font size

2009-02-08 Thread Scott David Daniels
exit from Idle and restart it. If this diesn't work, get back to me and we can try something more drastic. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: MacPython 2.5 IDLE font size

2009-02-09 Thread Scott David Daniels
I (Scott David Daniels) wrote: choha...@gmail.com wrote: Is there a way to adjust the default font size in IDLE, in MacPython 2.5? The default now is too tiny. I have to use this version of MacPython. As far as I searched, I can't find how I do this. If you can read what you have at all

Re: "Super()" confusion

2009-02-09 Thread Scott David Daniels
lePath) TypeError: super() argument 1 must be type, not classobj" What have I done wrong? Thanks in advance for any help. To use super, you must work with descendants of "object". So, just change your first line to: class Parent(object): and you should find your world back in

Re: UnitTest break on failure

2009-02-10 Thread Scott David Daniels
nittest.main() Note this gives you less information (the traceback doesn't go down to the actual error), but it shows you what step failed. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Functional schmunctional...

2009-02-10 Thread Scott David Daniels
rt 0 < ip_number < 1 << 48 bytes = [] while ip_number: bytes.append(ip_number & 255) ip_number >>= 8 assert len(bytes) in (4, 6) return '.'.join(str(n) for n in reversed(bytes)) --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: zlib interface semi-broken

2009-02-10 Thread Scott David Daniels
vote for two cans. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: zlib interface semi-broken

2009-02-10 Thread Scott David Daniels
o nasty problem guessing what to parameterize and what to fix in stone. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Avoiding argument checking in recursive calls

2009-02-10 Thread Scott David Daniels
raise ValueError return 1 return fact(n - 1) * n But really, iteration is the solution to this, and avoiding the right answer is a mistake. I couldn't resist fixing your test so you do one less layer of recursion. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.

Re: zlib interface semi-broken

2009-02-11 Thread Scott David Daniels
Travis wrote: On Tue, Feb 10, 2009 at 01:36:21PM -0800, Scott David Daniels wrote: I personally would like it and bz2 to get closer to each other... Well, I like this idea; perhaps this is a good time to discuss the equivalent of some "abstract base classes", or "i

Re: zlib interface semi-broken

2009-02-11 Thread Scott David Daniels
Paul Rubin wrote: Scott David Daniels writes: Seems like we may want to say things like, "synchronization points are too be silently ignored." That would completely break some useful possible applications, so should be avoided. No, I mean that we, _the_users_of_the_interface_, m

Re: zlib interface semi-broken

2009-02-11 Thread Scott David Daniels
Paul Rubin wrote: Scott David Daniels writes: I suspect that is why such an interface never came up (If you can clone states, then you can say: "compress this, then use the resultant state to compress/decompress others." The zlib C interface supports something like that. It i

Re: zlib interface semi-broken

2009-02-11 Thread Scott David Daniels
Scott David Daniels wrote: ... I've wanted to do some low-level (C-coded) search w/o bothering to create strings until a match Here's a more common use case: signature gathering on the contents. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listi

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-12 Thread Scott David Daniels
are available for a price. ActiveState, for example, sells one. The issue in each case is sharing things that the programs have every right to expect that they "own." To wit, Display refresh points, the main program, the keyboard, tcp/ip ports, the mouse. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

__import__ Confusion

2009-02-12 Thread scott . bronson . nelson
Can someone explain to me what's going on here? >>> __import__('some.package.module', {}, {}, []) >>> __import__('some.package.module', {}, {}, ['']) (Note that '' is two single quotes) Thanks, Scott -- http://mail.python.org/mailman/listinfo/python-list

Re: Help: makefile in Windows

2009-02-12 Thread Scott David Daniels
distutils, and write a setup.py. You will want to use mingw32. Searching for "building python25 C extensions mingw32" should point you right. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-13 Thread Scott David Daniels
me. OK, you are using the oldest and least useful revision control system, "rename and remember." I'd suggest you get and use bazaar, but you'll just ask for shortcuts on how to use it without understanding what it does. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Fortran array in python (f2py?)...

2009-02-14 Thread Scott David Daniels
ook into the numpy external package, because those arrays are _far_ superior for actual calculation. With numpy you can do array_1 + array_2 without requiring a Python loop. I'm sure it has a way to read in binary arrays of the various data types. --Scott David Daniels scott.dani...@acm.org

Re: Pythonic way to determine if a string is a number

2009-02-15 Thread Scott David Daniels
input) return True except ValueError: try: num = int(input, 0) # Convert to int, base spec in arg return True except ValueError: return False --Scott David Daniels scott.dani...@acm.org -- http://mail.pytho

Re: Will multithreading make python less popular?

2009-02-16 Thread Scott David Daniels
andrew cooke wrote: Thanks a lot for writing this, I'll be pointing to it from time to time. Were I writing such a thing I'd focus too much on the how (issues I know that non-GIL true concurrency faces), and not enough on the high level view. Bravo. --Scott David Daniels scott.dani.

Re: logging and daemons

2009-02-16 Thread Scott David Daniels
t sys class MyFakeStdout(object): def flush(self): pass def write(self, text): sys.stderr = sys.stdout = MyFakeStdout() --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: printing bytes to stdout in Py3

2009-02-17 Thread Scott David Daniels
sending a picture, for example, all possible byte sequences might show up. If the default encoding is "utf-8", for example, there are byte sequences which are illegal. I suspect you are confused by thinking each byte must map to a character; such an encoding could never suffice for

Re: print string as raw string

2009-02-17 Thread Scott David Daniels
r = "r" + r.replace('', '\\') assert not r.endswith('\\') return r ... The big issue I see is that lots of values cannot be represented as raw strings. Your code checks for a final '\', but many "control" cha

Re: how to list all installed modules

2009-02-18 Thread Scott David Daniels
se mode (You will get a _lot_ of output). Then, when you (finally) get a ">>>" prompt, type: >>> import pygame and you will see eaxctly what lookups are tried. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Q about Turtle Gfx

2009-02-18 Thread Scott David Daniels
t;> t = turtle.pen() >>> print(repr(t)) The pen returned (which you named t) is a simple dictionary. You can, however, follow up with: >>> turtle.forward(23) >>> turtle.right(90) >>> turtle.forward(32) >>> turtle.right(90) >>> turtle.forward(23

Re: Threading and tkinter

2009-02-18 Thread Scott David Daniels
t="Exit", command=root.destroy) button.pack(side=TK.BOTTOM) reader = Weegbrug(frame, svar, filename) button = Tkinter.Button(frame, text="Go", command=reader.start) button.pack(side=TK.BOTTOM) root.mainloop() if __name__ == '__main__': main(__f

Re: Revision Control

2009-02-19 Thread Scott David Daniels
merge back. Most checkins to the central repository _are_ merges. That is why everyone talks about merge speed. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Threading and tkinter

2009-02-19 Thread Scott David Daniels
names). 2) The last statement could more easily be written: root.after(500, display) ... root.after(500, lambda:display()) Again you can write this: root.after(500, display) --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: os.fdopen giving "Invalid Argument" from pipes

2009-02-19 Thread Scott David Daniels
wards consistency in spelling over correctness. Spelling "recievers" the same way 1000 times is better than getting it correct 999 times and "wrong" once. :-) --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange array.array performance

2009-02-19 Thread Scott David Daniels
ance bug vector.fromstring(n * 8 * '\0') return vector Once numpy is up and running on 2.6, this should be easy to convert to a call to zeroes. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange array.array performance

2009-02-19 Thread Scott David Daniels
ancient floating points did not use all-0 bytes for 0.0). --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Implementaion of random.shuffle

2009-02-20 Thread Scott David Daniels
Steven D'Aprano wrote: On Wed, 18 Jul 2007 19:32:35 +, George Sakkis wrote: ... Wow, can you make a coffee in.. 57ms ? [snip demonstration of xrange raising an exception] Of course! Can't you? And if I use a microwave oven, [*** deleted section outlining Guido's time machine structur

Re: Python won't run

2009-02-20 Thread Scott David Daniels
messages to the command window that help diagnose. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: how to assert that method accepts specific types

2009-02-21 Thread Scott David Daniels
): print obj --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Wanted: Online Python Course for Credit

2009-02-21 Thread Scott David Daniels
y Dr. André Roberge 88. Seven ways to use Python's new turtle module Mr. Gregor Lingl But make no mistake, you need to mingle when you are there to get the inspiration you'll want. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't find Python Library packages in Ubuntu (Debian)

2008-11-24 Thread Scott David Daniels
y about affecting the standard environment. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Install modules with no root privilegies

2008-11-24 Thread Scott David Daniels
location without having to cook up a custom PYTHONPATH. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: max(), sum(), next()

2008-11-24 Thread Scott David Daniels
lack presidents of the US. Which one was the tallest? I know the answer to that one: All of them! Heh. Mysteries of the empty set. _and_, as it turns out, sets of cardinality 1. --Scott David Daniels (pleased about the change in cardinality) [EMAIL PROTECTED] -- http://mail.python.org/m

Re: unicode and hashlib

2008-11-28 Thread Scott David Daniels
ode to produce the same hashes, say that. A hash is a means to an end, and it is hard to give advice without knowing the goal. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing NumPy and SciPy in Python 2.6

2008-11-28 Thread Scott David Daniels
to 2.5. If you can wait until early next year (and/or have the round tuits to help), go with 2.6. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode and hashlib

2008-11-29 Thread Scott David Daniels
ors (UTF-32BE and UTF-32LE), and whatever your current Python, you may well switch between UTF-16 and UTF-32 internally at some point as you do regular upgrades (or BE vs. LE if you switch CPUs). --Scott David Daniels [EMAIL PROTECTED] you'll have to decide , but you could -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question: if var1 == var2:

2008-11-29 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: Hi All, I dont understand why the following code never finds "tree". I could not find the answer in the Python tutorials. Here is the code, test43.in, and runtime: #!/usr/bin/python fname = open("test43.in") var = 'tree' for item in fname: print "item: ", item,

Re: Debugging in Python

2008-11-29 Thread Scott David Daniels
Python mode (the current one does not work well in a "leave tabs alone" mode). Even for me, the Komodo debugger is the bee's knees. I have never worked at ActiveState; I am only a (mostly) satisfied customer. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: 'new' module deprecation in python2.6

2008-11-29 Thread Scott David Daniels
Test = new.classobj( ^^^ replace with: Test = type( 'Test', (FirstBase, SecondBase), attr) class MyNewClass(Test): pass a = MyNewClass() print a.foo, a.buz, a.fiz, type(a) > ... It's really that simple. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode and hashlib

2008-11-29 Thread Scott David Daniels
Scott David Daniels wrote: ... If you now, and for all time, decide that the only source you will take is cp1252, perhaps you should decode to cp1252 before hashing. Of course my dyslexia sticks out here as I get encode and decode exactly backwards -- Marc 'BlackJack' Rintsch ha

Re: Debugging in Python

2008-11-29 Thread Scott David Daniels
Stef Mientki wrote: The debugging ability of the Komodo IDE is _significantly_ better than the freely available debuggers. If you like the Komodo Editor, you'll love the debugger. hi Scott, can you tell us, > why Komodo debugger is better than PyScripter or even Winpdb(rpdb2) used

Re: Version upgrade blocked mentally

2008-11-29 Thread Scott David Daniels
running on 2.6. The next few months should change that situation. So, if you are using numpy or scipy, for example, you'd do better to go with 2.5 for now, and only move over when the full set of packages you use are working on 2.6. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.pyth

Re: end of print = lower productivity ?

2008-11-29 Thread Scott David Daniels
ecognize subdirs. Then maybe you'll type: \wi <^D> \sy \<^D> <^D> \dr <^D> A directory-specific recog char was one of MS's nice improvements. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugging in Python

2008-11-29 Thread Scott David Daniels
it on, as I remember. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode and hashlib

2008-11-30 Thread Scott David Daniels
nd the recipient decodes the nonsense back into the message. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode and hashlib

2008-12-01 Thread Scott David Daniels
"", line 1, in hashlib.md5(b.decode('utf-8')).hexdigest() File "C:\Python26\lib\encodings\utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 4: ordinal not in range(128) Incidentally, MD5 has fallen and SHA-1 is falling. Python's hashlib also includes the stronger SHA-2 family. Well, the choice of hash always depends on the app. -Scott -- http://mail.python.org/mailman/listinfo/python-list

Re: Good introductory book?

2008-12-04 Thread Scott David Daniels
"just selected recipes" -- the recipes are picked in subject groups, edits applied, and introductions to each section are written by someone chosen for their expertise in that area. You defintely get more than the list of recipes to examine. --Scott David Daniels [EMAIL PROTECTE

Re: pretty strange behavior of "strip" FORGET THE LAST ONE

2008-12-05 Thread Scott David Daniels
7;toc.html', '01.html', '05.html', '07.html', '02.html', '08.html'] >>> test[4] 'toc.html' >>> test[4].strip('.html') 'oc' >>> test[2].strip('.html') 'questions' Well, why does ' a b c '.strip() leave two spaces? --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Shed Skin 0.0.30, an experimental (restricted-)Python-to-C++ Compiler

2008-12-05 Thread Scott David Daniels
Mark Dufour wrote: Hi all, I have just released version 0.0.30 of Shed Skin, ... Normally, including a link is a good idea. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining whether a variable is less/greater than a range.

2008-12-08 Thread Scott David Daniels
nds', [x for x in (b, c) if not 10 <= x <= 21] I do advise working through the tutorial before asking. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, threading

2008-12-11 Thread Scott David Daniels
for results in iter(combined_results.get, None): --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary idiom needed

2008-12-11 Thread Scott David Daniels
lls like homework without a particular application. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: (Very Newbie) Problems defining a variable

2008-12-12 Thread Scott David Daniels
feb...@gmail.com wrote: ... elif bank >= 1 and bank <= 24999: rate = 0.0085 > ... Also, (although not useful here as others have pointed out), note that particular code means the same thing as: ... elif 1 <= bank <= 24999: rate = 0.008

Re: Output to file gets lost - don't know where to look ...

2008-12-14 Thread Scott David Daniels
f.label.destroy() and seeing if that quick-fix lets you go farther. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Python shows up checking votes

2008-12-14 Thread Scott David Daniels
ed "Unique Transparency Program Uncovers Problems with Voting Software" --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Rename of .mdb file -- lock

2008-12-15 Thread Scott David Daniels
to rename during that period. So, a failure should retry in a second a couple of times before giving up. This is my understanding, but someone deeply familiar with Windows internals might reveal that I am operating on older information. --Scott David Daniels scott.dani...@acm.org -- http://mail.

Re: Removing None objects from a sequence

2008-12-15 Thread Scott David Daniels
clearer code, but by nowhere near as much. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: tricky nested list unpacking problem

2008-12-15 Thread Scott David Daniels
head + [element] + tail): yield row break else: if source: # Just to make expands([]) return an empty list) yield source def answer(source): '''Do the requested printing''' for row in expands(source): print

Re: Need help improving number guessing game

2008-12-16 Thread Scott David Daniels
mini, maxi)) These changes are mostly: (1) Negated tests are harder yo read (2) raise and return change the flow of control, so if ...: else: ... is "fat" (more trouble to read). (3) Adopting to the new 3.0 string formatting. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

<    10   11   12   13   14   15   16   17   18   19   >