My phone my accounts my home network have all been affected because of someone
using coding from Python and Linux and GitHub and json. I don't even know what
this stuff is but how do I get rid of it all. It's ruined my life.
Sent from my iPhone
--
https://mail.python.org/mailman/listinfo/pytho
On Tue, 12 May 2015 02:35:23 +1000, Steven D'Aprano wrote:
> On Mon, 11 May 2015 11:37 pm, Mel Wilson wrote:
>
>> On Sun, 10 May 2015 14:12:44 -0500, boB Stepp wrote:
>>
>>> I have to admit being surprised by this, too. I am just now studying
>>> on h
eory through Doug Hofstadter's
_Goedel, Escher, Bach_, or some essays in _Metamagical Themas_.
Generally speaking, making a computer totally incapable of doing Wrong
Things leaves it incapable of doing anything at all.
Mel.
--
https://mail.python.org/mailman/listinfo/python-list
s to the class problems in Algol and
re-wrote them to be run in FORTRAN. It was a fine first-hand look at
what the "general purpose" in General Purpose Computer really meant.
There was no confusing the machine and the language after that. Scheme/
Python would be even more radical, I thin
On Sat, 09 May 2015 03:49:36 +1000, Chris Angelico wrote:
> Yes, but can you *distinguish* them in terms of default argument versus
> code object creation? How do you know that the function's code object
> was created when compile() happened, rather than being created when the
> function was defin
sights.
Each GamePlayer object has an "update" method which accepts info from the
joystick and updates the player's movements, and a "draw" method which
the main loop calls on displaying every frame, to show the player's new
position and attitude.
You might
exactly the
> same as corporate culture.
IIRC Thompson, Ritchie, et al. were working at Bell Labs. Legend has it
that management would not buy them a Multics, so they were forced to
write their own using the hardware they had.
Mel.
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 19 Apr 2015 09:03:23 -0700, Rustom Mody wrote:
> Now if Thomson and Ritchie (yeah thems the guys) could do it in 1970,
> why cant we revamp this 45-year old archaic program=textfile system
> today?
Dunno. Why not? There's half of you right there.
--
https://mail.python.org/mailman/lis
On Wed, 08 Apr 2015 07:56:05 -0700, jonas.thornvall wrote:
> There is no need for inventing a new set of characters representing
> 32-bit numbers. You will not be able to learn them by heart anyway,
> unless they build on a interpretation system binaries, decimals.
See Jorge Luis Borges, _Funes t
On Tue, 07 Apr 2015 23:19:49 -0700, jonas.thornvall wrote:
> And you have just created 429496729 unique symbols ;), in a pencil
> stroke.
No. You did that, when you said base 429496729. Representing the
symbols in a computer is no problem, any Python long int can do that. To
display the symb
quot;the quickest way to get a Knuth algorithm running in Python", this is a
pretty good idea. My own preference is to get the algo "really" coded in
Python, but that usually takes a fair bit of time and effort.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
t;
> Whether you like it or not, it simply is a fact that in English (I won't
> speak for other languages) people use colons without the first clause
> *necessarily* being a complete sentence. They write things like this:
>
> Star Wars Episode IV: A New Hope
Come to
emove every Python wart that a
bunch of people could imagine. The band of developers might have had the
steam for the new object model, but they didn't have the steam to do
everything.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
em.
That looks like it. Tcl is the 'LISP of strings' Composite-object things
like indexing work on space-separated strings.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
:
if isinstance (other, Least):
return 0
return -1
def __hash__ (self):
return id (Least)
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
main so that it returns after it's done all the things it's
supposed to do. If you've sprinkled `sys.exit()` all over your code, then
don't do that. If you're forced to deal with a library that hides
`sys.exit()` calls in the functions, then you have my sympathy. Library
authors should not do that, and there have been threads on c.l.p explaining
why they shouldn't.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
ns just what I choose it to mean — neither more nor less.' (_Through the
Looking Glass, Lewis Caroll). And you, too, have that ability.
Contrariwise see Knuth, _The Art of Computer Programming_ Section 5.2.2,
Algorithm B.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
s then next less extreme into the new end element.
It does extra swaps because it combines the swap operation with recording
the temporary extreme while it searches the subrange.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
gt;
> It's so simple that it's not mentioned anywhere. I guess it's called
> "selection sort" but I'm not sure. The minimum selection sort is an
> improvement of this one.
It's what Wikipedia says a selection sort is: put the least element in [0
in the EVP unit
tests m2crypto/tests/test_evp.py in the m2crypto installation.
Good hunting, Mel.
--
http://mail.python.org/mailman/listinfo/python-list
NG, under your control.
Jon Bentley somewhere, sometime, published a portable PRNG for that exact
reason. (I wish I could find that article.) Specifically he wanted
portability across various manufacturer's O/Ss.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
ling an exception that didn't involve the C library at all.
As a C coder there are times when it's wise to clear errno yourself to make
sure your code doesn't get fooled.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
>>> def f(x):
... exec x
... exec 'print a'
...
>>> f('a=4')
4
>>>
works, but I really cannot explain why.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
t I once set out to
create a recursive tuple by using the C API, and it turned out then that the
C API went to some lengths to prevent anyone being able to do that. I did
finally do it in some peculiar way, but it wasn't simple. The c.l.python
archives might still have the post where I described it.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
e type to require to denote a collection of exceptions.
You see a similar decision, with the opposite emphasis, with the string
modulo operator. The second operand is supposed to be a tuple, but if the
template string needs only one value, then the rules are relaxed and any
single non-tuple value is used as-is.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
, [ZeroDivisionError])
excepter (0, (ZeroDivisionError,))
excepter (1, (ZeroDivisionError,TypeError))
excepter (1, (ZeroDivisionError,))
#---
excepter called with the list catches nothing, of course.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
raged when people try to write big overloaded functions
that check the types of the arguments to decide what they should be doing.
In diagnostics and tests like the OP's there should be no problem.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
o check within __init__ for a string argument
that could be parsed as a bearing, and failing that fall back to treating
the argument as a numeric angle.
Neither fish nor fowl would be to accept named arguments for the different
kinds of values.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
> Some code will rely on it. I know mine does.
In a tool that's meant for other people to use to accomplish work of their
own, breaking workflow is a cardinal sin.
In a research language that's meant always to be up-to-date with the concept
of the week, not so much.
Mel.
-
Chris Angelico wrote:
> On Fri, Dec 23, 2011 at 1:13 AM, Hans Mulder wrote:
>> How about:
>>
>>
>> ...
>>
>>
>> More more readable! And it's a standard!
>
> Unfortunately it's not Pythonic, because indentation is insignificant.
Chris Angelico wrote:
> It's no more strange than the way some people omit the u from colour. :)
Bonum Petronio Arbiteri, bonum mihi.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
ther as a pair in a single
generator call. As it is, there's a chance of the blarg and boo
generators getting out of step and supplying mismatched names.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
possible while ignoring any further
> exceptions.
>
> But this looks really awkward. And in the case that two files fail
to
> close, I am not sure the best strategy is to ignore the second
> failure.
I imagine you could save any caught exception instances in a list and
study the
. ]
It gives you an out in a case like
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> os = 5 # number of 'o's
>>> imp
', 'a', ' ', 's',
> 't', 'r', 'i', 'n', 'g']"
>>>>
Well, as things stand, there's a way to get whichever result you need. The
`list` constructor builds a single list from a single iterable. The list
literal enclosed by `[`, `]` makes a list containing a bunch of items.
Strings being iterable introduces a wrinkle, but `list('abcde')` doesn't
create `['abcde']` just as `list(1)` doesn't create `[1]`.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
ough.
In my own code, I usually define a separate class descended from wx.Panel to
create a page3 instance with its own sizers, then create one of those with a
a wx.Notebook instance as a parent, and add it to the notebook:
def _new_capture_page (self):
new_trace = TraceWindow (self.tracebook)
self.tracebook.AddPage (new_trace, 'Capture %d' %
(self.capture_serial,), select=True)
return new_trace
Hope this helps,
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
s the obvious way to do it.
>
>
> "If the key is not in the ignition, you won't be able to start the car."
>
> "If not the key is in the ignition, you won't be able to start the car."
>
>
> Who like that second one speaks?
:)
"If th
you might want that, whatever it
was, to happen. I see that kind of documentation way too often. By
comparison, even this <https://www.ubersoft.net/comic/hd/2011/09/losing-
sight-big-picture> might seem good. At least they try.
"Does things to the stuff. By default, the mos
done this with ints (usually in small embedded systems) I've
always preferred
low_limit + (total_width * i) / intervals
since it does the rounding on the biggest numbers where proportional error
will be least, and it's guaranteed to hit the low_limit and high_limit
exactly (as exactly as they can be represented, anyway.)
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
Mel wrote:
> This seems to work:
>
>
>
> class MetaWith (type):
> @classmethod
> def __enter__(cls):
> print("__enter__")
>
> @classmethod
> def __exit__(cls, exc_type, exc_value, traceback):
> print("__exi
("__enter__")
@classmethod
def __exit__(cls, exc_type, exc_value, traceback):
print("__exit__")
class With (object):
__metaclass__ = MetaWith
with With:
pass
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
_main__":
> _test()
>
> All tests are failing even though I am getting the correct output on
> the first two tests. And the last test still gives me "Of" instead of
> "of"
>
> Any help is appreciated.
I don't know about doctest -- I suspect it wants a structured docstring to
specify the tests -- but this
if title_split[0] in small_words:
new_title.append(word.title())
can't be what you want.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
would be the O.P.'s job.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
too big. If it's
too big, factoring it into sub-steps and making functions of some of those
sub-steps is the fix.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
mentError, or StandardError will detect the exception -- with
increasing levels of generality.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
3, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import itertools
>>> li1 = ['a', 'b']
>>> li2 = ['1', '2']
>>> map (lambda (x,y):x+y, list (itertools.product (li1, li2)))
['a1', 'a2', 'b1', 'b2']
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
Mel wrote:
> Yingjie Lin wrote:
>> I have two lists:
>>
>> li1 = ['a', 'b']
>> li2 = ['1', '2']
>>
>> and I wish to obtain a list like this
>>
>> li3 = ['a1', 'a2', 'b1',
__class__
__delattr__
__doc__
__format__
__getattribute__
__hash__
__init__
__iter__
__name__
__new__
__reduce__
__reduce_ex__
__repr__
__setattr__
__sizeof__
__str__
__subclasshook__
close
gi_code
gi_frame
gi_running
next
send
throw
in the form of the gi_code attribute. No idea what it's for, although no
reason to believe it shouldn't be there. (Very interesting demo you gave of
primitive object creation. I' awed.)
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
you intend to re-use the Dialog object, it's not a memory leak.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
roid/subscribe?hl=en_US>, <mailto:python-for-
android+subscr...@googlegroups.com>
. Tends to be pretty detail-oriented.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
roid/subscribe?hl=en_US>, <mailto:python-for-
android+subscr...@googlegroups.com>
. Tends to be pretty detail-oriented.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
ny help, I think (some of?) the database interface packages already
do just that, returning None when they find NULL fields.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
to assign a fresh message handler to a new input message. Docs are via the
Python Global Module Index, source is in some directory like
/usr/lib/python2.6/SocketServer.py , .../BaseHTTPServer.py , etc.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
once; that is when the def statement is executed.
Later on, when file_to_hash gets called, the value of m is either used as
is, as the default parameter, or is replaced for the duration of the call by
another object supplied by the caller.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
Ian Kelly wrote:
> On Wed, Jul 6, 2011 at 12:49 AM, Ulrich Eckhardt
> wrote:
>> Mel wrote:
>>> In wx, many of the window classes have Create methods, for filling in
>>> various attributes in "two-step construction". I'm not sure why,
>>> b
s have Create methods, for filling in
various attributes in "two-step construction". I'm not sure why, because it
works so well to just supply all the details when the class is called and an
instance is constructed. Maybe there's some C++ strategy that's being
supported there.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
Erik Max Francis wrote:
> Mel wrote:
>> Erik Max Francis wrote:
>>
>>> Chris Angelico wrote:
>>>> On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano
>>>> wrote:
>>>>> Zero sig figure: 0
>>> That's not really zero
one sig fig or two?
>
> Two.
>
>> (Just vaguely curious. Also curious as to
>> whether a zero sig figures value is ever useful.)
>
> Yes. They're order of magnitude estimates. 1 x 10^6 has one
> significant figure. 10^6 has zero.
By convention, nobody eve
uot;,
> it would be *disastrous* if iterables worked that way. I can't imagine
> how many bugs would occur from people reassigning to the loop variable,
> forgetting that it had a side-effect of also reassigning to the iterable.
> Fortunately, Python is not that badly designed.
And for an iterator like
def things():
yield 1
yield 11
yield 4
yield 9
I don't know what it could even mean.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
in this case, 20) would be an easy way of finding which numbers
> to test.
These are almost "trick questions" in a way, because of the math behind
them. If the question were "What is the tallest high-school student in
Scranton, PA?" then searching a population for the property would be the
only way to go. BUT you can also build up the answer knowing the
factorization of all the numbers up to 20.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
X_NOPERM', 'EX_NOUSER', 'EX_OK', 'EX_OSERR', 'EX_OSFILE',
'EX_PROTOCOL', 'EX_SOFTWARE', 'EX_TEMPFAIL', 'EX_UNAVAILABLE', 'EX_USAGE',
'F_OK', 'NGROUPS_MAX', 'O_APPEND', 'O_ASYNC', 'O_CREAT', 'O_DIRECT',
'O_DIRECTORY', 'O_DSYNC', 'O_EXCL', 'O_LARGEFILE', 'O_NDELAY', 'O_NOATIME',
'O_NOCTTY', 'O_NOFOLLOW', 'O_NONBLOCK
etc.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
watch. factors.py works, as does yours, by
testing for small factors first, but it divides them out as it goes, so it
tends to do its work on smallish numbers. And since the smallest factors
are taken out as soon as possible, they have to be the prime ones.
Good hunting, Mel.
--
http://mail.python.org/mailman/listinfo/python-list
hem into the standard game config files.
AFAIK you are stuck with the attributes the game is programmed for. I've
seen no way to create a new dimension for the game -- Conversation, for
instance, with currently unknown attributes like vocabulary or tone.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
icense" for more information.
>>> class Character (object):
... health = 50
... def __init__ (self, name):
... self.name = name
... print self.name, self.health
...
>>> Character ('Eunice')
Eunice 50
where the class attribute is used until it's overridden in the instance.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
d sequence
## 3: the rest of data
## so use str.split and str.match to pull out the individual arguments,
## and lastly
data = match.group (3)
This is all from memory. I might have got some details wrong in recognizer.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
rt a variable into the format
> specification to achieve the desirable padding.
>
> I would be much obliged if someone can give me some tips on how to
> achieve a variably pad a number.
:)
('%%0%dd' % (pads,)) % (n,)
Probably be good to wrap it in a function. It looks k
']) if 'e' else []+['dud']
which evaluates to
[]+['dud']+['e']
because the if...else finally takes the second branch since the x value is
now an empty string.
I've left the list additions undone .. tracing the actual data objects would
show plain lists. One of the disadvantages of lambdas is that you can't
stick trace printouts into them to clarify what's happening. Rewriting the
thing as a plain def function would be instructive.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
again when main
prints the object it knows as `a`. Python doesn't pass parameters by
handing around copies that can be thought of as local or global. Python
passes parameters by binding objects to names in the callee's namespace. In
your program the list known as `a` in main is identically the same list as
the one known as `c` in fnc2, and what happens happens.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
users get at the internals, but things
like this make it worthwhile.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
do_some_things()
result = range (start, stop, span) # range doesn't(/didn't) accept this
return result
Tne answer in that case was to take *args as the parameter to wrapped_range
and count arguments to distinguish between the different calls to range.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
a tuple of suffixes to look for. With
> optional start, test beginning at that position. With optional end, stop
> comparing at that position.
>
> Any reason this is not a bug?
It's a wart at the very least. The same thing happened in Python2 with
range and xrange; there seemed no way to explicitly pass "default"
arguments.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
"copyright", "credits" or "license" for more information.
>>> f = open ('xyzzy.txt')
>>> f.name
'xyzzy.txt'
>>> import os
>>> os.getcwd()
'/home/mwilson'
>>> os.chdir('sandbox')
>>> f.name
'xyzzy.txt'
If you open a file and don't get a full path from os.path.abspath right
away, the name in the file instance can get out-of-date.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
roubles of its own; I never took it
through the knock-down drag-out disarticulation that would show what the
problems were.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> Some day, we'll be using quantum computers without memory addresses, [ ...
] it will still be possible to
> represent data indirectly via *some* mechanism.
:) Cool! Pass-by-coincidence! And Python 3 already has dibs on the
'nonlocal' keywor
d avoided FORTRAN's troubles the same way. Your function could corrupt
*a* 4, but it wouldn't corrupt the *only* 4.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
rouble testing among float(5), int(5), Decimal(5) ...
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
assignment works by rebinding. The two different bindings in
foo.__dict__ and globals() get bound to different integer objects.
Note too the possible use of `globals()['foo'].__dict__['var'] . (Hope
there are no typos in this post.)
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
identify_call (my_list)
>>> my_list
["If you can see this, you don't have call-by-value"]
so it's neither call-by-value nor call-by-reference as (e.g.) C or PL/I
programming would have it (don't know about Simula, so I am off topic,
actually.) It's not so wrong to think of Python's parameter handling as
ordinary assignments from outer namespaces to an inner namespace.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
Westley Martínez wrote:
> On Fri, Apr 22, 2011 at 10:08:20AM -0400, Mel wrote:
[ ... ]
>> But sys.exit() doesn't return a string. My fave is
>>
>> Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
>> [GCC 4.4.3] on linux2
>> Type "help", "co
ignored
Exception RuntimeError: 'maximum recursion depth exceeded while calling a
Python object' in ignored
Error in sys.excepthook:
RuntimeError: maximum recursion depth exceeded
Original exception was:
Traceback (most recent call last):
File "", line 1, in
RuntimeError: maximum recursion depth exceeded while calling a Python object
>>>
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
erl needs two completely
different kinds of comparison -- one that works as though its operands are
numbers, and one that works as though they're strings. Surprises to the
programmer who picks the wrong one.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
Mel wrote:
> Laszlo Nagy wrote:
> `ukeys` isn't a different dictionary from `self.updates.keys` I'ts merely
> another name referring to the same dict object. I think
>
> ukeys = dict (self.updates.keys)
>
> would do what you want.
Sorry. Belay that.
gt; k is d.keys()
> False
>
> So what is wrong with this iterator? Why am I getting this error message?
`ukeys` isn't a different dictionary from `self.updates.keys` I'ts merely
another name referring to the same dict object. I think
ukeys = dict (self.updates.keys)
would do what you want.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
I guess this means that a function's
> default arguments are evaluated in the parent context, but the body is
> evaluated in its own context?
The operation of calling a function has to evaluate arguments provided in
the caller's namespace and assign them to variables in the called
ne:
return "right", tree_node.right
where adding the "left" and "right" markers makes the return? feature
impossible to use.
The proposed feature reminds me of the `zod` function (was that the actual
name?) that returned 0 rather than bringing on a Ze
ge is
good when you can get it, especially for abstract things like that.
I can sort of guess that `dir` was perhaps coded in C for speed and doesn't
spend time looking for complicated argument lists.
Python is a pragmatic language, so all the rules come pre-broken.
Mel.
--
http://mai
th something else:
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> bool(y=5)
Traceback (most recent call last):
File "", line 1, in
TypeError: 'y' is an invalid keyword argument for this function
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
Do you have an example of this wasteful litigation?
>
> You have to be kidding, right? Check *any* of the sites I listed
> above and read about it... software idea patent litigation is a business
> now worth billions of dollars per year.
One of the premier sites:
http://www
odd Unicode character sets is going to be foreign,) and
generally internationalized data processing.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
> the error message i posted.
>
> So its not that the if condition is wrong but something happens with
> the form variable 'mail' .
My wild guess is that the trouble is in `if "@" in mail` . You can only
test somthing `in` something if the second thing i
gt; F2: 0xBC
> F7: 0xC1
True. The key-release codes are the key-press codes (the "key numbers")
but with the high-order bit set.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
here any reason why cmp being a useful
> argument of sort should indicate that __cmp__ should be retained in
> classes.
I would have thought that the upper limit of cost of supporting cmp= and
key= would be two different internal front-ends to the internal
internal sort.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
get(attribute, lambda x: True)(value):
raise ValueError ('error out of bound')
or define a subclass of ValueError just for this purpose. On error, the
program will stop just as dead, but you'll get a trace.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
in more than, say, one underscore. That way, nice descriptive
application module names like 'analyzer_tool_utils' and such would always be
safe to use.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
d)
[ ... ]
'_qinf_force32' : 0x
> }
I handled this problem in a kind of cheap, nasty way with (untested)
for k, v in QCam_Info.items():
QCam_Info[v] = k
Then the dictionary lookups work both ways.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
-- a lot of blue sky at sunny mid-day;
> -- a bit of light white clouds in the sky;
>
> In short,
> the notion of similarity can be speculated about just endlessly.
Exactly. That's the kind of similarity I would call valid. That's what my
algorithms, if I ever finis
s an argument
and moved the `for v in ...` inside the function.)
> Would a database in a file have any advantages over a file made
> by marshal or shelve?
Depends. An sqlite3 database file is usable by programs not written in
Python.
> I'm more worried about the fact that a python
ubes the complexity of the answer.
Might be too complicated to know what to do with an answer like that.
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
mage_rank.py bears2.jpg *.jpg
bears2.jpg
bears2.jpg0.00
bears3.jpg 15.37
bears1.jpg 19.20
sky1.jpg 23.20
sky2.jpg 23.37
ff1.jpg 25.30
lake1.jpg 26.38
water1.jpg 26.98
ff2.jpg 28.43
roses1.jpg 32.01
I'd vaguely wanted to do something like this for a while, but I never dug
far enough into PIL to even get started. An additional kind of ranking that
takes colour into account would also be good -- that's the first one I never
did.
Cheers, Mel.
--
http://mail.python.org/mailman/listinfo/python-list
eed that level of precision just to gather all
> the students into the auditorium?
You would think so, but darned if some of them don't wind up in a
*different* *auditorium*!
Mel.
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 347 matches
Mail list logo