Re: Can I set up a timed callback without Tkinter or twisted or something?

2006-10-14 Thread Scott David Daniels
its not a GUI app. Use a thread that uses something like: def action(): sleep(50) if not canceled: callback(foo) as its action. The callback ill be in another thread, but Look up threading for more details. --Scott David Daniels [EMAIL PROTECTED] -

Re: beginner's refcount questions

2006-10-30 Thread Scott David Daniels
s there a way to query the use count > of an object? This would be useful for debugging and testing. >>> import sys >>> sys.getrefcount(42 * 7) 2 --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Overriding traceback print_exc()?

2006-10-31 Thread Scott David Daniels
es above don't do anything (the return decrefs the locals). > return(excinfo_str) The parens here can be skipped as well: return excinfo_str -- --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Style for modules with lots of constants

2006-11-02 Thread Scott David Daniels
Constants then becomes a nice place to define methods to convert values to associated names for debugging and such. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Projecting MUD maps

2006-11-06 Thread Scott David Daniels
B, C a.east, b.east, c.east = A, B, C A.west, B.west, C.west = a, b, c -- --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does this code crash python?

2006-11-12 Thread Scott David Daniels
ring formatting. For this portion, you could quite simply: totalsecs = int(whatever) print '%02d:%02d' % divmod(totalsecs, 60) Or, depending on your leading zero requirements: totalsecs = int(whatever) print '%2d:%02d' % divmod(totalsecs, 60) --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Array? Please help.

2006-05-28 Thread Scott David Daniels
Dr. Pastor wrote: > Scott David Daniels wrote: >> Dr. Pastor wrote: >>> I need a row of 127 bytes that I will use as a >>> circular buffer. Into the bytes (at unspecified times) >>> a mark (0>> After some time the "buffer" will contain the last

Re: Array? Please help.

2006-05-28 Thread Scott David Daniels
Scott David Daniels wrote: > Dr. Pastor wrote: >> Scott David Daniels wrote: >>> Dr. Pastor wrote: >>>> I need a row of 127 bytes that I will use as a >>>> circular buffer. Into the bytes (at unspecified times) >>>> a mark (0>>&g

Re: deleting item from ListCtrl by pop-up menu

2006-05-29 Thread Scott David Daniels
ons wud b of great help... This is a wxPython question, not a Python question. Ask on the wxPython group. Available on gmane as gmane.comp.python.wxpython --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: send an email with picture/rich text format in the body

2006-05-29 Thread Scott David Daniels
annot remember when I have last > received a relevant email that I could not read in text mode. Because (A) This _is_ a technical newsgroup with mores you are violating. (B) Some of us "technical users" avoid such email/news readers precisely because they can cause tra

Re: Large Dictionaries

2006-05-29 Thread Scott David Daniels
ndled faster than random data. If you are using your gut without testing, go ahead and presort. In any case, reading documents and testing beats gut feels every time. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Ricerca Programmatore Python

2006-05-29 Thread Scott David Daniels
native Chinese speaker who has put the work into learning enough English to get by and is confronted with yet another European language to decipher. In consideration for such people, please limit yourself to English. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/

Re: iterator? way of generating all possible combinations?

2006-05-30 Thread Scott David Daniels
: yield single + rest for v in Counter('ab', Counter('cd', Counter('ef', Counter('gh': print v This works with "iterables" (and produces), rather than "iterators", which is vital to the operation.

Re: iterator? way of generating all possible combinations?

2006-05-30 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Scott David Daniels wrote: > >> This works with "iterables" (and produces), rather than "iterators", >> which is vital to the operation. >> >> --Scott David Daniels >> [EMAIL PROTECTED] > > Sorry, it doe

Re: TIming

2006-05-30 Thread Scott David Daniels
WIdgeteye wrote: > Thank you very much for your participation. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: "initializer element is not constant"

2006-05-30 Thread Scott David Daniels
of Python with cygmin (I've no idea if that compile cleanly). If you want to use the MinGW approach, your call to setup is something like "python setup.py -compiler=mingw32 -build " (look it up, there are more details to know about. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: iterator? way of generating all possible combinations?

2006-05-30 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Scott David Daniels wrote: >> Sorry, "re-iterables". A file re-iterable is: >> >> class FileReIterable(object): ... >> def __iter__(self): >> self.file.seek(0) >> return iter(self

Re: shuffling elements of a list

2006-05-30 Thread Scott David Daniels
43, 11, 0, 30, 49, 32, 44, 24, 47, 42, 27, 23, 28, 12, 18, 13, 35, 1, 34, 25, 45, 21, 20, 46, 38, 17, 31, 6, 4, 14, 41, 51, 19] Don't be so sure the advice you get is wrong. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: wx: PyNoAppError

2006-05-31 Thread Scott David Daniels
sier. This is the inevitable result of running a pair of GUIs simultaneously: They both want control of the main program to run their idle loop, and only can win. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: iterator? way of generating all possible combinations?

2006-05-31 Thread Scott David Daniels
Jim Segrave wrote: > In article <[EMAIL PROTECTED]>, > Scott David Daniels <[EMAIL PROTECTED]> wrote: >> class FileReIterable2(object): >> ... >> def __iter__(self): >> self.file.seek(0) >> f

Re: Save data to a file thru a http connection

2006-05-31 Thread Scott David Daniels
o the tutorial and this and many other things will become clear. Instead of just "print sometext", do something like: ... f = open('filename', 'w') ... print >>f, sometext ... (possibly more prints like the above). f.clo

Re: TSV to HTML

2006-06-01 Thread Scott David Daniels
Brian wrote: > One question (and this is a topic that I still have trouble getting my > arms around). Why is the text in STYLEBLOCK tripple quoted? Because triple-quoted strings can span lines and include single quotes and double quotes. -- --Scott David Daniels [EMAIL PROTECTED] --

Re: An oddity in list comparison and element assignment

2006-06-01 Thread Scott David Daniels
velope containing five $100 bills is equal to an envelope containing five $100 bills with different serial numbers? --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Zope / Plone Groups

2006-06-01 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > are there any specific groups for zope / plone regarding questions? Check gmane (google for it). -- --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommendations for CD/DVD-based or on-line Python classes?

2006-06-01 Thread Scott David Daniels
you could read through all the web thingies around (the online tutorial is great), many others listed "getting started" should help, and to really build your muscles, try the "Python challenge." -- --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Open Source Charting Tool

2006-06-02 Thread Scott David Daniels
ss thing on .com) is where the main > developers of ReportLab (a library freely available on www.reporlab.org) > work. So what you want really is .org, but apparently it's having > problems right now. > Or, you could look for: http://www.reportlab.org/

Re: C# equivalent to range()

2006-06-05 Thread Scott David Daniels
a polite question. If this were not true, then all manner of spam would be polite. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: GUI Program Error

2006-06-08 Thread Scott David Daniels
C:\Python24\pythonw.exe C:\Python24\Lib\idlelib\idle.pyw to: C:\Python24\pythonw.exe C:\Python24\Lib\idlelib\idle.pyw -n That "target", by the way, can also be typed directly to the command line to start Idle in "no subprocess" mode. The big advantage to using Idl

Re: Newbie question about updating multiple objects ...

2006-06-08 Thread Scott David Daniels
g and then updating. -- --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions about extending Python...

2006-06-09 Thread Scott David Daniels
re a couple of standard answers. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: wxpython: how do i write this without the id parameter?

2006-06-12 Thread Scott David Daniels
wx.BoxSizer(wx.HORIZONTAL) panel.SetSizer(sizer) sizer.Add(wx.Button(panel, label='OK'), 0, wx.ALL, 10) sizer.Add(wx.Button(panel, label='Cancel'), 0, wx.ALL, 10) class MyApp(wx.App): def OnInit(self): frame = InputForm(title='Data

Re: Writing PNG with pure Python

2006-06-12 Thread Scott David Daniels
enses for software." I had one lawyer tell me the MIT license was better at declaring your non-liability than BSD. IANAL, your lawyer may vary, -- --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: convert floats to their 4 byte representation

2006-06-14 Thread Scott David Daniels
yteswap() return ' '.join(hexx(ord(char), 2) for char in data.tostring()) def fours(number, swap=False): data = array.array('f', [number]) if swap: data.byteswap() return ' '.join(hexx(ord(char), 2) for char in data.tostring()) --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Bundling an application with third-party modules

2006-06-14 Thread Scott David Daniels
ose third-party packages; they likely aren't getting money for their contribution. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Numerics, NaNs, IEEE 754 and C99

2006-06-14 Thread Scott David Daniels
til now, I think you can send a pickle of a data structure and unpickle it on a different processor to get equivalent data. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: wxpython: how do i write this without the id parameter?

2006-06-14 Thread Scott David Daniels
John Salerno wrote: > Scott David Daniels wrote: > >> class InputForm(wx.Frame): >> def __init__(self, parent=None, id=-1, title=__file__): > > Also, is there a way to define parent and id with defaults, but not > title? Is it good to change the order around to d

Re: Question about the Exception class

2006-06-14 Thread Scott David Daniels
rror," Your exception may have some specific data that assists you in discovering the source of the problem. Meanwhile, any code that says: try: something() except ValueError, error: ... will catch your new exception in the ValueError clause. Subclasses of ex

Re: better Python IDE? Mimics Maya's script editor?

2006-06-14 Thread Scott David Daniels
ot certain, but you could take a look at Komodo from ActiveState. I do have an interactive window, edit window(s), and an output window. You can get a free trial from them, as I remember. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Which compiler will Python 2.5 / Windows (Intel) be built with?

2006-06-15 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Hi everyone, > > which compiler will Python 2.5 on Windows (Intel) be built with? Same as for Python 2.4 (the decision was taken a while ago). Intel sells a compatible compiler, I believe. -- --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.or

Re: Python is fun (useless social thread) ;-)

2006-06-15 Thread Scott David Daniels
ce OO) give you is a way of saying, "I'd like something a bit like a module, but I'd like to make several of them, and not have them interfere with each other." That is the big intuition about objects, the rest is just details. --Scott David Daniels [EMAIL PROTECTED] --

Re: Python is fun (useless social thread) ;-)

2006-06-15 Thread Scott David Daniels
fallen in love with Python as both a programming language and a way of expressing algorithms to other programmers (who didn't necessarily know it was Python I was writing). --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is fun (useless social thread) ;-)

2006-06-15 Thread Scott David Daniels
Scott David Daniels wrote: > John Salerno wrote: ... And I didn't quote him at all, so my post looks like it was attributed to him, rather than in response to his message. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: a good programming text editor (not IDE)

2006-06-15 Thread Scott David Daniels
) about learning VI: "The two weeks you'll spend hating vi (or vim) as you learn it will be repaid in another month, ad the rest is pure profit." -- --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Which compiler will Python 2.5 / Windows (Intel) be built with?

2006-06-15 Thread Scott David Daniels
ible to purchase suitable versions of VC6. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: list of polynomial functions

2006-06-15 Thread Scott David Daniels
for i in range(n): polys.append(lambda x: polys[i](x)*x) i=3 The lambda-defined functions will be called after the for loop is done, at which time the "i" (from the surrounding environment) will have a value of 3. Hope this makes it a bit clearer. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Which compiler will Python 2.5 / Windows (Intel) be built with?

2006-06-15 Thread Scott David Daniels
Jarek Zgoda wrote: > Sorry, gals and guys, but if you force us to buy something irrelevant > like VC2003, you will not get our sympathy. Oh, no. And just when our bank account was getting full from your appreciation of our efforts. --Scott David Daniels [EMAIL PROTECTED] --

Re: Which compiler will Python 2.5 / Windows (Intel) be built with?

2006-06-15 Thread Scott David Daniels
developers used the Visual Studio toolkit. As to MinGW, nobody has signed up to commit long-term to doing the PyDev work that is required to get (and keep) it working. Such a developer would be welcome. There _are_ notes out there on the web to help you get such things going; I have done my own

Re: a good programming text editor (not IDE)

2006-06-15 Thread Scott David Daniels
Istvan Albert wrote: > Scott David Daniels wrote: > >> To paraphrase someone else (their identity lost in my mental fog) about >> learning VI: >> "The two weeks you'll spend hating vi (or vim) as you learn it will >> be repaid in another month

Re: Which compiler will Python 2.5 / Windows (Intel) be built with?

2006-06-15 Thread Scott David Daniels
Scott David Daniels wrote: > Jarek Zgoda wrote: >> Sorry, gals and guys, but if you force us to buy something irrelevant >> like VC2003, you will not get our sympathy. > Oh, no. And just when our bank account was getting full from your > appreciation of our efforts. Sorry gu

Re: python texts?

2006-06-17 Thread Scott David Daniels
s everything to do with what you prefer. The Cookbook comes later. As does getting all the way through the challenge, but for puzzle lovers, it can be great fun. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Which compiler will Python 2.5 / Windows (Intel) be built with?

2006-06-17 Thread Scott David Daniels
through its language systems, and has used that edge to knock off other compilers (such as WatCom) by providing header files that are not standard C compatible. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Which compiler will Python 2.5 / Windows (Intel) be built with?

2006-06-17 Thread Scott David Daniels
st a strawman, but that was really for other readers, not for you. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: mapping None values to ''

2006-06-18 Thread Scott David Daniels
> More like: [(i, "")[i in ("None", None)] for i in [a,b,c]] -- --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple script to make .png thumbnails from .zip archive...

2006-06-18 Thread Scott David Daniels
pil/handbook/image.htm - The Image > Module That, by the way, is the "PIL" library that you'll see a lot about -- The Python Imaging Library that the effbot is justly proud of. You won't do better than that. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Which compiler will Python 2.5 / Windows (Intel) be built with?

2006-06-19 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Also, there are many free software programs that use special > features of GCC and cannot be compiled using another compiler. This is precisely what bothers me about standardizing on GCC -- lock-in is lock-in whether you must pay cash or not. --Scott David D

Re: Newbie Question

2006-06-19 Thread Scott David Daniels
quot;red", "brown"]) for line in file: words = set(line.split()) if words & search_words: for word in search_words: if word in words: if word == 'red': print 'weasels rip my flesh' else: print word ... --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: [PIL]: Image size in runtime

2006-06-20 Thread Scott David Daniels
ten discard the cStringIO object. -- --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How to truncate/round-off decimal numbers?

2006-06-20 Thread Scott David Daniels
rmat it, use '%.2f' % (float(a)/b) Sybren has this right. If you follow everyone else's advice, you'll eventually discover: >>> print round(11024. / 5000.1, 2) only gives you "2.2", not "2.20" (which is what, I suspect, you want). --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: comparing two arrays

2006-06-20 Thread Scott David Daniels
umerate(zip(a, b)) if v[0] == v[1] ] > > You're right, that design stemmed from my first broken version. Or even deconstruct to avoid the (very mildly confusing) v[0], v[1]: [i for i, (left, right) in enumerate(zip(a, b)) if left == right] -- --Scott David Daniels [EMAIL PROTECTED] -- ht

Re: __getattribute__ doesn't work on 'type' type for '__class__'

2006-06-20 Thread Scott David Daniels
'__getattribute__' method which will get used, but I doublbt thre is a promise for an exposed name '__getattribute__'. -- --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: need helping tracking down weird bug in cPickle

2006-06-20 Thread Scott David Daniels
ory (flag manipulation), you can get these values in different ways. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How to truncate/round-off decimal numbers?

2006-06-21 Thread Scott David Daniels
t tracked the "decimal point" (or "binary point" or whatever) in the mind of the programmer, not in the state of the hardware. There never was "fixed point hardware," it was simply a way of viewing the results of the gates of the same hardware we use today. --

Re: serial port servo control

2006-06-23 Thread Scott David Daniels
Several have suggested struct, I'd suggest you look at array: import array v = array.array('B', [1, 2, 3]) for i in range(17): v[i % 3] *= max(1, i // 3) v.tostring() --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Clearing pythonwin environment

2006-06-23 Thread Scott David Daniels
#x27;__name__', 'pywin', 'keep', 'item', 'globs']) # Faster to test globs = globals() for item in dir(): if item not in keep: del globs[item] del globs, item Note that this leaves all imported modules imported. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Clearing pythonwin environment

2006-06-23 Thread Scott David Daniels
Network Ninja wrote: > Scott David Daniels wrote: >> keep = set(['__builtins__', '__doc__', '__name__', >> 'pywin', 'keep', 'item', 'globs']) # Faster to test >> globs = globals()

Re: sum fonction in gadfly

2006-06-24 Thread Scott David Daniels
t; It means that the select command does not add but concatenates the > different amounts. Why ? Sounds like you selected columns are strings, not numbers. Remember '123.5' + '-23' is '123.5-23', while 123.5 + -23 is 100.5 You need the amount column of the transac

Re: What is Expressiveness in a Computer Language

2006-06-25 Thread Scott David Daniels
simply bugs in the theory." --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: sum fonction in gadfly

2006-06-25 Thread Scott David Daniels
ents out; you'll get better advice. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: style question

2006-06-26 Thread Scott David Daniels
27; to indentation Riffing on this idea: message = """ This is line 1 This is line 2 This is line 3 """.replace(""" """, '\n')[1:] --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Formatted string to object

2006-06-26 Thread Scott David Daniels
janama wrote: > i can use this: > aaa = 1 > result = eval("self.b%s.SetBitmapDisabled(self.yellow)" % aaa) > > How would i to achieve this with getattr() ? result = getattr(self, 'b%s' % aaa).SetBitmapDisabled(self.yellow) --Scott David

Re: Extracting 3-byte integers

2006-06-26 Thread Scott David Daniels
27;, (msb * 65536 + low for msb, low in itertools.izip(sbytes, uhalf))) That was fun. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Inconsistent float behaviour on "inf" - current state?

2006-06-27 Thread Scott David Daniels
uld require a lot of code generated on each operation, and without common hardware, the infinity / denormal / NaN behavior would mean code at every floating point operation. The C standards body was not interested in that work. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: mmap as a sequence behavior

2006-06-28 Thread Scott David Daniels
done before it gets to your C code. I suspect if you don't define a __len__ method, you'd suppress this. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: style question

2006-06-29 Thread Scott David Daniels
system for C++ code, See Knuth on Literate Programming and the "Web" systems (e.g. CWeb). His goal is to look good typeset with explanation, and extract-to-compile. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: efficiency question

2006-06-30 Thread Scott David Daniels
big_dispatch_table = {} for function, keys in [ (doStuff, ["abc", "def", "xyz"]), (doOtherStuff, ["pqr", "tuv", "123"]), ... ]: for key in keys: big_dispatch_table[key]

Re: print shell output in a file

2006-07-01 Thread Scott David Daniels
ry: <<>> finally: old_output, sys.stdout = sys.stdout, old_output old_output.close() print 'Output safely written to:', old_output.name --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create a limited set of instanceses of a class

2006-07-01 Thread Scott David Daniels
# You could go over here if threading is an issue instance = super(class_, Limited).__new__( class_, *args, **kwargs) class_._held_instances[id(instance)] = instance return instance return ra

Re: Threading HowTo's in Windows platforms

2006-07-01 Thread Scott David Daniels
ally predictable (and hopefully testable) parts with a logable communication pattern. You still may have trouble (to which the best reply is, "See, we told you so."). --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Non-ASCII languages

2006-07-01 Thread Scott David Daniels
t). All of this was in the mid seventies or earlier. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary .keys() and .values() should return a set [with Python 3000 in mind]

2006-07-01 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > I can't speak for your code, but this is the most common use of keys in > my coding: > # d is some dictionary > keys = d.keys() > keys.sort() > for k in keys: > #blah This you can rewrite quite effectively as: for k in sorted(d):

Re: Odd behavior with staticmethods

2006-07-01 Thread Scott David Daniels
o apply (and looking for things like "__metaclass__" and "__slots__"). For more on all of this read the language reference, esp. the "Data Model" section, and probably that on the difference between old-style and new-style classes. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Odd behavior with staticmethods

2006-07-01 Thread Scott David Daniels
bject): ... is a new-style class. class Whoever(SomeClass): ... is an old-style class if SomeClass is an old-style class, and a new-style class if SomeClass is a new-style class. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Non-ASCII languages

2006-07-01 Thread Scott David Daniels
things go, at least by comparison. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie graphing recommendations ?

2006-07-02 Thread Scott David Daniels
able graphs). Also look at PyGame if you want to paint screens. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: conecting with a MsAcces DB by dao

2006-07-03 Thread Scott David Daniels
mn field1. The proper SQL clause is: ... WHERE field1 LIKE 'e*' ... But, you did not include that part of the program, so you wound up crippling those who were willing to try to help you, because you thought you kinda-sorta knew what was going on (but not enough to fix it). Find "

Re: Classes and global statements

2006-07-03 Thread Scott David Daniels
d test. Your reasoning is off in the ozone. You waste a lot of time creating great theories; make tiny theories and _test_ them. <> --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: sending binary data over sockets

2006-07-03 Thread Scott David Daniels
ant is mutability in a pattern, read the array module documentation as well. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary .keys() and .values() should return a set [withPython3000 in mind]

2006-07-03 Thread Scott David Daniels
. But copy-on-write in the presence of reference counts doesn't do the mad useless-copy stuff. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a good idea or a waste of time?

2006-08-28 Thread Scott David Daniels
; 429, or _something_ problem specific. saying that x must be an int is almost always simultaneously too specific and too general. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: unit test for a printing method

2006-08-28 Thread Scott David Daniels
yprog.A('simple') self.assertEqual(sys.stdout.getvalue(), '---simple---\n') def tearDown(self): sys.stdout = self.held if __name__ == '__main__': unittest.main() --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Best Python Books and Sites

2006-09-08 Thread Scott David Daniels
the best three python books they own? Sounds great! Send me $1.50 and I'll send you my six answers. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it just me, or is Sqlite3 goofy?

2006-09-22 Thread Scott David Daniels
is to modify the the interpreter. We could call the new language "Python?!", or actually use an interobang if Unicode has such a character. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Automatic methods in new-style classes

2006-09-29 Thread Scott David Daniels
return self.forwarder(name) raise AttributeError("%r object has no attribute %r" % (self.__class__.__name__, name)) --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Automatic methods in new-style classes

2006-09-29 Thread Scott David Daniels
Scott David Daniels wrote: > > class Forwards(object): > > to_forward = set(['flush', 'read', 'write', 'close']) > > def __init__(self, backends): > self.backends = backends > > def forwarder(self, methodn

Re: Battlefield Weapon Popularity Trend

2006-10-01 Thread Scott David Daniels
stir" in Spanish has a > similar meaning, but not exactly the same, as "to resist" As we all know, a "resistir" has a reactance that doesn't vary with frequency, unlike an "inductir". --Scott David Daniels (who couldn't resist) [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: a query on sorting

2006-10-01 Thread Scott David Daniels
g the arg to "reversed" to a list. While "sorted" could be special cased for those cases, the chances of real useful code containing, "sorted(xrange(a, b, c))" are pretty slim. If you don't have to build the list in memory, returning a list can make a program tha

Re: How to change menu text with Tkinter?

2006-10-01 Thread Scott David Daniels
any menu elements are ordered alphabetically, the result of changing the language will be jarring to the user, as well as expensive to implement. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: windev vs python SOS

2006-10-01 Thread Scott David Daniels
they seem to contradict everything a power-point wielding IT executive who understands everything "from a 5000 foot point of view" knows to be true. I really wish I knew how to explain these things politically. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Auto color selection PIL

2006-10-01 Thread Scott David Daniels
s in restricted ranges and varying orders); the contrast may be more substantial even to a viewer with full color vision. -- --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: a different question: can you earn a living with *just* python?

2006-10-01 Thread Scott David Daniels
tectural directions at the same time as you learn an assembly language. You can still execute it (plenty of simulators are available for free), and you can get an idea of kinds of efficiency without having to learn five or six architectures. --Scott David Daniels [EMAIL PROTECTED] -- http://mai

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