Re: Need Tutorial For the following lib

2008-05-31 Thread Scott David Daniels
rself. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking each item in m.group()?

2008-06-02 Thread Scott David Daniels
m.groups()) You can avoid problems w/ possible 0s or 0.0s or .. by using: (str(c) or "NULL") for c in groups()) the "or" (or a similar "and" trick) will continue to work. The different "empty" or "nothing" values of

Re: time module methods give an am or pm value ?

2008-06-07 Thread Scott David Daniels
shows courtesy. Few people mind explaining unclear documentation when the confusing part is identified (and they know the answer). Similarly, asking (5000?, a million?) to each spend a second so you can save an hour is bad economics. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/ma

Re: Q re documentation Python style

2008-06-08 Thread Scott David Daniels
color='red') You can even use your arg dictionaries in transitional code: call_dict = {'value': 23, 'age': 6, 'scale': 2.5, 'metrics': 2, 'validity': 'strong', 'color': 'red'} f(**call_dict) --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing a path to components

2008-06-10 Thread Scott David Daniels
return [head] # Perhaps result = [''] here to an indicate ends-in-sep head, tail = os.path.split(head) while head and tail: result.append(tail) head, tail = os.path.split(head) result.append(head or t

Re: An idiom for code generation with exec

2008-06-22 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > On 20 juin, 21:44, eliben <[EMAIL PROTECTED]> wrote: ... >> The generic version has to make a lot of decisions at runtime, based >> on the format specification. >> Extract the offset from the spec, extract the length. ... ... > Just my 2 cents. Truth is that as long as i

Re: Passing arguments to subclasses

2008-06-23 Thread Scott David Daniels
a tease; I think it would take pages to address the issue in a comprehensible way for someone who hasn't thought about the issues. If you are curious enough to pursue it, image some issues, design experiments, and see if you can ask a coherent question; if not, "YAGNI" (You Aint Gon

Re: Bit substring search

2008-06-25 Thread Scott David Daniels
nized: if : yield block, where, recognized else: yield block, where, 0 --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: where is the error?

2008-06-28 Thread Scott David Daniels
solve your problem, why avoid trying it simply because it might not do so? Sorry, this a long form of "read smart questions," but it did include some suggestions about how you could find the problem in your particular case. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: list extension ?

2008-06-29 Thread Scott David Daniels
;t plan to have more than several thousand at any one time). Lists (for that matter most Python builtin types) get used a lot, so they have that built in. You can observe that even on the most trivial extensions: class AttributableInt(int): pass class AttributeFreeInt(int): __slots__ =

Re: Loading just in time

2008-07-10 Thread Scott David Daniels
... _remote('some_tax') _remote('other', 'frogs') ... * The pythonic "enough motive" is how redundant your "__init__.py" looks. The "DRY" (Don't Repeat Yourself) principle comes into effect. The more your so

Re: Why is this blowing the stack, thought it was tail-recursive...

2008-07-12 Thread Scott David Daniels
s how to use it to avoid redundant comutation: _next_entry = _Fibonacci_gen().next _sofar = [] def fib(n): while len(_sofar) <= n: _sofar.append(_next_entry()) return _sofar[n] --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/list

Re: Python internals

2008-07-16 Thread Scott David Daniels
tion(s) slowed down, much as C performance would suffer is access to RAM slowed down. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Need Python Programmer (preferentially in Los Angeles)

2008-07-16 Thread Scott David Daniels
"seems like it is a simple job." Beware of customers who know something will take little effort without being able to characterize that effort. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: trying to match a string

2008-07-18 Thread Scott David Daniels
t_string) <= set('LMR') --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Written in C?

2008-07-22 Thread Scott David Daniels
ent to had an LGP-30, and I learned to program on it. Rumor had it that a student from two years before me used to work late in the lab, and allow the janitors to play blackjack, and it is further rumored that he made a bit of money leaning on the transfer control button. --Scott David Daniels

Re: fromfile error on windows, not mac

2008-07-22 Thread Scott David Daniels
bytes that have issues are 10 and 13. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about inheritence

2008-07-22 Thread Scott David Daniels
e __init__ method, if available To elaborate a bit on Fredrik's response, there is a sense in which Python has constructors, but, to the extent it does, a constructor is the __new__, __init__ pair. For immutables, everything happens in __new__, for mutables, most things happen in the __init__

Re: maximum value in a column of file

2008-07-23 Thread Scott David Daniels
with fortran or bash, but i'm learning python), that the reason why i tried to use numpy. Look into the csv module (comma separated values). It also can deal with tab separated values. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: write unsigned integer 32 bits to socket

2008-07-28 Thread Scott David Daniels
Alan Franzoni wrote: Michael Torrie was kind enough to say: Of course any time you send coherent numbers over the network, I highly recommend you use what's called network byte order I'm sure python has some convention in the struct module for dealing with this. Not in the struct module;

Re: Swap memory in Python ? - three questions

2008-07-29 Thread Scott David Daniels
those results together. This is a place to apply human intellect, not machine effort. So, sorry, there is no way to solve the problem without understanding the field it occurs in and the question being addressed by the code. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/lis

Re: Licensing

2008-03-29 Thread Scott David Daniels
is in an honorable way? As the author of several of those recipes, I definitely expect others to use them. I'd hate to slow them up by requiring them to ask permission, but would appreciate an acknowledgment. -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with python

2008-03-29 Thread Scott David Daniels
Those details matter. If you are doing wxPython programming, for example, you cannot easily use IDLE for your program (GUI systems fight for control of the display). -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python in High School

2008-04-02 Thread Scott David Daniels
built this code in order to teach intro physics: they thought that (and continue to teach classes as if) it was _easier_ to teach Python and the physics than to teach physics alone! -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Directed Graph Traversal

2008-04-02 Thread Scott David Daniels
you have the minimal solution in the set you've chosen. I actually did a cheapest-first search; adding an edge each time. There is a post-join pruning step that was (as I recall) fairly simple. -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Rationale for read-only property of co_code

2008-04-02 Thread Scott David Daniels
; In the end, it's all a matter of convenience, I guess. Nope: If you change the code in-place, the whole stack's references to where they were running would need to get updated to corresponding locations in the new code. _That_ is a lot of work. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting Directories from files in a os.listdir??

2008-04-10 Thread Scott David Daniels
Soren wrote: > Hi, > > I'd like to read the filenames in a directory, but not the > subdirectories, os.listdir() gives me everything... how do I separate > the directory names from the filenames? Is there another way of doing > this? > > Thanks! import os base, files, dirs = iter(os.wa

Re: Rounding a number to nearest even

2008-04-11 Thread Scott David Daniels
bdsatish wrote: > The built-in function round( ) will always "round up", that is 1.5 is > rounded to 2.0 and 2.5 is rounded to 3.0. > > If I want to round to the nearest even, that is > > my_round(1.5) = 2# As expected > my_round(2.5) = 2# Not 3, which is an odd num > > I'm inter

Re: About __init__ and default arguments

2008-04-12 Thread Scott David Daniels
): > if not keyword: keyword = self.default > return "A %s in time saves nine." % (keyword) Several things are false (for example: '', 0, False, [], ...) If you can get along with the code you have suggested, I'd think about using: def franklin(self, keyword): return

Re: Request a short code review

2008-04-17 Thread Scott David Daniels
message, change that last line to: try: return random.choice(lessons) except IndexError: print "Unable to find lessons of type %s." % type raise -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Database vs Data Structure?

2008-04-19 Thread Scott David Daniels
appens as if it were happening at its own moment in time -- tou don't worry about other transactions interleaved with your transaction. * Durability: Once a transaction actually makes it into the database, it stays there and doesn't magically fail a l

Re: Is 2006 too old for a book on Python?

2008-04-25 Thread Scott David Daniels
sions are included, with the differences color-coded. You can reassure yourself that the vast majority of the language remains the same. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: how to convert a multiline string to an anonymous function?

2008-04-30 Thread Scott David Daniels
whatever name you need Diez ... Or, you can even more simply do: text = ''' def f(state): print state return True ''' lcl = {} exec text in globals(), lcl and lcl will be a dictionary with a single item: {'f' : }

Re: Photo gallery software

2008-05-01 Thread Scott Sandeman-Allen
tagging: <http://code.google.com/p/django-tagging/> It easily allows configuration of different image sizes and integrates with generic templates providing gallery and detail view support. HTH Scott -- http://mail.python.org/mailman/listinfo/python-list

Re: Python documentation

2008-05-03 Thread Scott David Daniels
ly, I've loved most hours I've spent on Knuth -- I'd hate to deprve anyone of that experience. -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Colors for Rows

2008-05-04 Thread Scott David Daniels
can write, and then speed it up when it needs it. I'd use len(bg) above unless my code was littered with calls to len of the same thing, in which case it might it might be clearer to choose a good name for len(bg). --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help - Tkinter not doing anything

2008-05-04 Thread Scott David Daniels
he Idle you get with this "corrupts" more easily, since the "-n" says "no subprocess." Things like restarting the shell don't work. _But_ Tkinter stuff is available (there is already a running mainloop). You can interactively do simple things a step at a time and watch the results. It is a _great_ way to experiment with Tkinter. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested os.path.join()'s

2008-05-05 Thread Scott David Daniels
Paul Scott wrote: ... example: if os.path.exists(os.path.join(basedir,picdir)) == True : blah blah Question is, is there a better way of doing this? The above *works* but it looks kinda hackish... You've had the joining addressed elsewhere, but note that: if os.path.e

Re: Problems with os.walk

2008-05-08 Thread Scott David Daniels
erator.next() ... --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: POP connection timeout.

2008-05-08 Thread Scott David Daniels
hon 2.4. Can anyone help me implement this timeout functionality. Obviously, get a copy of 2.5 and back-port the poplib code as poplib25 or some such. If you want more help than that, hire someone to do it. --Scott David Daniels -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic importing question

2008-08-20 Thread Scott David Daniels
ments "smells" as bad as one with a single element, just in a different way. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Tkinter

2008-08-23 Thread Scott David Daniels
Right-click the shortcut and select the "properties" menu. On the "General" tab of the Properties window: Give the shortcut a nicer name (I use Idle25-n for mine). On the "Shortcut" tab of the properties window, add a space and a -n to the target li

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-23 Thread Scott David Daniels
I suspect the problem is with the back slash. A standard windows error. note that '\t' is a tab, and I doubt you have a directory named . Get in the habit of _always_ using: junkfile = open(r'c:\tmp\junkpythonfile','w') or junkfile = open('c:\\tmp\

Re: __eq__ problem with subclasses

2008-08-23 Thread Scott David Daniels
comparison to get the behavior you seem to want? --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: 'While' question

2008-08-23 Thread Scott David Daniels
er receptor, close at same level out_file = open(OUTPUT % receptor, 'a') for line in range(10): for ligand in (7, 9, 11, 13, 15, 17): extract_dist(out_file, receptor, line, ligand) out_file.close() --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: dropwhile question

2008-08-23 Thread Scott David Daniels
sequence). What you want is: list(x for x in range(10) if 2 < x < 5) Note that: list(itertools.dropwhile(lambda x: x<5, range(10)+range(10))) is [5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], not [5, 6, 7, 8, 9, 5, 6, 7, 8, 9]. --Scott David Daniels Scott.Daniels.Acm.Org -- http:

Re: Identifying the start of good data in a list

2008-08-26 Thread Scott David Daniels
lead = [] print list(started([0, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9])) --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: String/Number Conversion

2008-09-06 Thread Scott David Daniels
-1]] * int(value[: -1]) If this is really SI units, you likely are doing real measurements, so I'd consider using "float" instead of "int" in the above. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

wx

2008-09-11 Thread Desmond Scott E
_AUTOSIZE)) idx = self.GetNextItem(idx, wx.LIST_NEXT_ALL, wx.LIST_STATE_DONTCARE) Any help would be greatly appreciated! I do have Shrubbery! Scott Scott E. Desmond Director & Manager Equity Systems Development IT Integration Lead Mellon Capital Management Corporation 500 Grant Street, Suite

Re: What is "finally:" for?

2008-09-16 Thread Scott David Daniels
other error, but not the one you want. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Python, Factset, and Excel - Oh my!

2008-09-18 Thread Desmond Scott E
ld be greatly appreciated! Scott E. Desmond Director & Manager Equity Systems Development IT Integration Lead Mellon Capital Management Corporation 500 Grant Street, Suite 4200 Pittsburgh, PA 15258 T 412.236.0405 | F 412.236.1703 [EMAIL PROTECTED] | www.mcm.com The information contained in th

Re: Detecting the first time I open/append to a file

2008-09-23 Thread Scott David Daniels
? ... How about file.tell == 0? or have I misunderstood the requirement? OI thought roughly the same thing when I saw this, how about if not file.tell(): --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: writing dll in python?

2008-09-30 Thread Scott David Daniels
nking Python cannot handle calculation itself easily. Where you'll need to leave python is in array and matrix calculations, there the numpy code will get you near custom C/fortran code speeds. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Weirdness comparing strings

2008-09-30 Thread Scott David Daniels
] --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Tix: Windows XP: Problem - how to stop root window from popping up with Tix

2008-10-01 Thread Scott David Daniels
. And you can accomplish this as a "clicky" by renaming your program from "someprog.py" to "someprog.pyw". --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get the thighest bit position in big integers?

2008-10-05 Thread Scott David Daniels
1.0)[1] def high_bit(value): '''Find the highest order bit of a positive integer <= maxfloat''' assert value > 0 return math.frexp(value)[1] - EXP_OF_ONE --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: deriving from complex

2006-03-07 Thread Scott David Daniels
else: return complex(class_, x, y) Which will produce instances of complex. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: deriving from complex

2006-03-07 Thread Scott David Daniels
Scott David Daniels wrote: > Schüle Daniel wrote: >> ... And, of course, I reply with a cutto-pasto (pre-success code). > ... > Which will produce instances of Complex, or: > class Complex(complex): > def __new__(class_, x, y=0.0, polar=False): &

Re: deriving from complex

2006-03-07 Thread Scott David Daniels
* sin(angle)) --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: [exec cmd for cmd in cmds]

2006-03-08 Thread Scott David Daniels
d = dict([(i, eval(p % (i, i))) for i in range(20, 30)]) Strive to be clear first, terse second given the first is still achieved. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Type Hinting vs Type Checking and Preconditions

2006-03-08 Thread Scott David Daniels
ems can be found in C++ as well, but I never hunted very hard. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: encoding problem

2006-03-09 Thread Scott David Daniels
ve' Also shows me élève. With cmd.exe (the command line): c:\ python >>> print u'\xe9l\xe8ve' shows me élève, but I can't type in: >>> print u'lve' is what I get when I paste in the print u'élève' (beeps during paste). What do you get if

Re: First script, please comment and advise

2006-03-09 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: >> nested and hided inside a class. > > Hidden, sorry :-) > > >> Can a "sub-function" be called directly from outside the defining function? No, and each call to scramble_text defines a new function "scramble". Further, there

Re: Best way to have a for-loop index?

2006-03-09 Thread Scott David Daniels
better, cleaner, or easier way to get at the > element in a list AND the index of a loop than this? for elementIndex, myElement in enumerate(elementList): print "myElement ", myElement, " at index: ",elementIndex --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with a reverse dictionary lookup

2006-03-09 Thread Scott David Daniels
4: NoFoundry, 5:OnlyProcess, 6:OnlyVendor, 7: Nothing} def dispatch(f, p, v): return behavior[((f is None) * 2 + (p is None)) * 2 + (v is None)](f, p, v) ... dispatch('Intel', 'Silicon', None) --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Cheese Shop -> BSOL?

2006-03-11 Thread Scott David Daniels
http://cheeseshop.python.org http://larch.python.org and http://spam.python.org all get to the same page. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: how exactly do binary files work in python?

2006-03-13 Thread Scott David Daniels
for a line, but sends a CR ('\r' == '\15' == ASCII 13), which the I/O systems somewhere magically transforms into a LF ('\n' == '\12' == ASCII 10). The C standard (which evolved with Unix) does these translation "for you" (or "to you"

Re: Very, Very Green Python User

2006-03-13 Thread Scott David Daniels
hen you are designing "mixin" classes you can easily choose names that should not collide with the instance variable names of classes using your "mixin" classes. > I have plenty of docs and stuff, now I'm just looking for wisdom. As a > seasoned Python user, what do y

Re: Please, I Have A Question before I get started

2006-03-13 Thread Scott David Daniels
you pass up. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: list/classmethod problems

2006-03-13 Thread Scott David Daniels
"__main__"): > i1 = Item("one") > i2 = Item("two") > i3 = Item("three") > > p1 = Parent([i1, i2]) > p2 = Parent([i3]) > > print str(p1) > > Now you get the output you expect. By-the-by, why shouldn't the first class be simply?: class Item(object) def __init__(self, text=""): self.text = text Finally, defining __repr__ rather than __str__ will make it easier to fiddle with your code interactively w/o keeping anything from working. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Q's: pythonD and range(1,12)

2006-03-13 Thread Scott David Daniels
l size and creation date, differing > apparently only in name (python, python2.4 and python24.exe) and each of > exactly 2,597,888 bytes. What possible purpose could be served by such > triplication that couldn't more efficiently be done by other means? You obviously know what and where Py

Re: Python Debugger / IDE ??

2006-03-14 Thread Scott David Daniels
; > Every help is greatly appreciated. > > Thanks > If you don't mind spending (not so much) money, ActiveState's Komodo is a nice debugger. With it you can even debug a Python program on a remote machine over a network connection (ideal for GUI problems).

Re: andmap and ormap

2006-03-14 Thread Scott David Daniels
(limit): for i in xrange(limit): yield i * 7 - 4 > 100 any(generates(8)) True any(generates(8)) False --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Very, Very Green Python User

2006-03-15 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Scott David Daniels wrote: >> [EMAIL PROTECTED] wrote: >>> ... Is the Python debugger fairly stable? >> Yes, but it is not massively featured. The "Pythonic" way is to >> rarely use a debugger (test first and straightforwa

Markov process representation

2006-03-15 Thread Scott David Daniels
0)), (('B', 'A'), dict(A=35, B=25, C=40)), (('B', 'B'), dict(A=49, B=48, C=3)), (('B', 'C'), dict(A=60, B=20, C=20)),

Re: Markov process representation

2006-03-15 Thread Scott David Daniels
_all_states = set(key) -- key is a order-tuple of states. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Counting nested loop iterations

2006-03-17 Thread Scott David Daniels
Duncan Booth wrote: > Oh well, just wait until Python 2.5 comes out and we get people complaining > about the order of the new if statement. Or rather, the order of the new if _expression_. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode error

2006-03-17 Thread Scott David Daniels
ow that?), not picking a particular character. print >> htmlFile, (u'') % (1,) And if you don't mean to be writing unicode, you could use: print >> htmlFile, ('') % (1,) --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python installation problem

2006-03-17 Thread Scott David Daniels
use pieces of OS X may actually use the internal Python 2.3. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there no end to Python?

2006-03-18 Thread Scott David Daniels
ut how they do it and their priorities are about zero to one. Kind of like the core developers saying, rather than getting more users of this language, I'd prefer they submit careful bug reports with money attached to fix the bugs -- ain't gonna happen. --Scott David Daniels [EMAIL PRO

Re: Have you ever considered of mousing ambidextrously?

2006-03-18 Thread Scott David Daniels
eople used to the original optional chord pad, so I find the Apple "users can't count past one" attitude strange. With the chord pad and three-button mouse, you could fill in forms without touching the keyboard. http://www.cedmagic.com/history/first-computer-mouse.html --

Re: Python 2.5 Schedule

2006-03-18 Thread Scott David Daniels
nger any legal way to get a VC 6.0 compiler. This round at least is sticking with the same compiler as Python 2.4 (VC 7.0). The new 2005 compiler flags much of the Python source with complaints about perfectly legal ANSI C constructs, and a "clean build" is a strong preference of the PyD

Re: Have you ever considered of mousing ambidextrously?

2006-03-18 Thread Scott David Daniels
Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > Scott David Daniels <[EMAIL PROTECTED]> wrote: > >> Roy Smith wrote: >>> I never understood why people switch mouse buttons. I'm left handed, so I >>> put the mouse on the left side of my k

Re: POP3 Mail Download

2006-03-18 Thread Scott David Daniels
27; % line if not line.strip(): break chunk = sys.stdin.read(23) # reads a series of bytes from sys.stdin Warning: idle does not implement line iteration as in the for loop. Also the read in both line iteration and .read(N) may well read the input in "block mode&quo

Re: Python 2.5 Schedule

2006-03-19 Thread Scott David Daniels
Gregory Petrosyan wrote: > P.P.S. are there any experiments with compiling CPython with Intel's > compiler? Yup, the (older) Intel compiler was quite effective for 2,2 and 2.3 (at least), and I think at least one distro was built with it. -- -Scott David Daniels [EMAIL PROTECTE

Re: ANNOUNCE: xlrd 0.5.2 -- extract data from Excel spreadsheets

2006-03-19 Thread Scott David Daniels
ther. It also helps that you mention what pyExcelerator is good at. -- -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Unpythonic? Impossible??

2006-03-19 Thread Scott David Daniels
if want_a_B1(*args, **kwargs): return B1(*args, **kwargs) elif want_a_B2(*args, **kwargs): return B2(*args, **kwargs) return super(B1, class_).__new__(class_, *args, **kwargs) --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Unpythonic? Impossible??

2006-03-19 Thread Scott David Daniels
Felipe Almeida Lessa wrote: > Em Dom, 2006-03-19 às 08:54 -0800, Scott David Daniels escreveu: >> class A(object): >> def __new__(class_, *args, **kwargs): >> if class_ is A: >> if want_a_B1(*args, **kwargs): >>

Re: New-style Python icons

2006-03-20 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > > You can also see a preview here: > http://www.doxdesk.com/img/software/py/icons.png Maybe you could change the ink color to better distinguish the pycon and pyc icons. -- -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listin

Re: Function params with **? what do these mean?

2006-03-23 Thread Scott David Daniels
u told us how you tried to answer the question for yourself. So, anyhow, thanks for taking the time to write your question properly. -- -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiplying all the values in a dictionary

2006-03-23 Thread Scott David Daniels
er/faster/cleaner way to achieve this ? To update, I'd either go with that or Felipe's list comprehension. If you just want the value of the result, how about: doubled = dict((key, [x * 2 for x in values]) for key, values in d.iteritems()) -- -Scott David

Re: a problem to solve

2006-03-27 Thread Scott David Daniels
f two's complement notation): v & -v == isolated least significant bit of v math.log(v & -v, 2) == bit number of least significant bit. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing func_name from inside a function

2006-03-27 Thread Scott David Daniels
has convinced me that programs are defined in print, not structures. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: object references

2006-03-27 Thread Scott David Daniels
gely',)) print eg, getattr(*ref_attr), getattr(*ref_other) But you might consider this: class Another(Example): """ Test primary Key assignment """ key = ('one', 'two') def getkey(v): return [getattr(v, part) for part in v.key] if __name__ == "__main__": eg2 = Another(3.1415, 3+4j, 'pi') print eg2, getkey(eg2) eg2.one = 'First PK Elem' print eg2, getkey(eg2) setattr(eg2, 'two', u'Strangely') print eg2, getkey(eg2) -- -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: problems with looping, i suppose

2006-03-27 Thread Scott David Daniels
) except FloatingPointError: print 'never reached' print 'This is not reached either' except ValueError: print 'proper exception' raw_input('Pause and reflect:') --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Find similar images using python

2006-03-29 Thread Scott David Daniels
," a judgment quite reasonable in a legal system based on trusted authorities, but not a good one in a society "ruled by laws and not men." --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a language/framework

2006-03-31 Thread Scott David Daniels
s a persistent store, without the normal SQL feature of "our DB admin can tune this up to fly like a peregrine in full stoop." A query planner for well-insulated objects just doesn't have enough information about what it can and cannot rewrite, so it doesn't know how to e

Re: Find similar images using python

2006-03-31 Thread Scott David Daniels
> > E-mail me if you want the module, I don't think I have it currently online > anywhere. This sounds like a great recipe for the cookbook: http://aspn.activestate.com/ASPN/Cookbook/Python -- -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie string conversion question

2006-04-01 Thread Scott David Daniels
rsion, try: def mangle(digits): length = (len(digits) + 1) >> 1 v = int(digits, 16) mask = int('0F' * length, 16) smunch = (v ^ (v >> 4)) & mask swapped = v ^ (smunch | (smunch << 4)) return ''.

Re: Looking for a language/framework

2006-04-01 Thread Scott David Daniels
racting away the meaningful structure. The database structures built are as good a DB organization as code generated by code generation programs: the meaning is obscured, and the generated (structure / code) is hard to work with. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

<    14   15   16   17   18   19   20   21   22   >