I have a substantial wxpython-based application that I'm trying to port from
python-2 to -3.
Almost everything is working properly, except for a few small but important
sections that use
the OGL library. That executes without any exceptions, but the objects created
within the
diagram/canvas
On Sat, 23 Feb 2019 14:56:03 +1100, Chris Angelico wrote:
> On Sat, Feb 23, 2019 at 2:51 PM Frank Miles
> wrote:
>>
>> I have a Debian/Linux machine that I just upgraded to the newer
>> "testing"
>> distribution. I'd done that earlier to another m
I have a Debian/Linux machine that I just upgraded to the newer "testing"
distribution. I'd done that earlier to another machine and all went
well. With the latest machine, python2 is OK but python3 can barely run
at all. For example:
$ python3
Python 3.7.2+ (default, Feb 2 2019, 14:31:48)
On Wed, 12 Apr 2017 04:18:45 -0700, Masoud Afshari wrote:
> filename ="Ex_resample" +'_sdf_'+ str(n)+'.dat'
> with open(filename, 'rb') as f: #read binary file data = np.fromfile(f,
> dtype='float64', count=nx*ny) #float64 for Double precision float numbers
> Ex = np.reshape(data, [ny, nx], ord
On Tue, 04 Apr 2017 08:01:42 -0700, venkatachalam.19 wrote:
> Hello All,
>
> I am writing a python code for processing a data obtained from a sensor. The
> data from sensor is obtained by executing a python script. The data obtained
> should be further given to another python module where the r
On Tue, 28 Mar 2017 15:38:38 -0400, Terry Reedy wrote:
> On 3/28/2017 2:51 PM, Frank Miles wrote:
>> I tried running a bit of example code from the py2.7 docs
>> (16.6.1.2. Exchanging objects between processes)
>> only to have it fail. The code is simply:
>
I tried running a bit of example code from the py2.7 docs
(16.6.1.2. Exchanging objects between processes)
only to have it fail. The code is simply:
#
from multiprocessing import Process, Queue
def f(q):
q.put([42, None, 'hello'])
if __name__ == '__main__':
q = Queue()
On Thu, 11 Feb 2016 14:29:04 +, cl wrote:
> I am trying out wxGlade on Linux, version 0.7.1 of wxGlade on xubuntu
> 15.10.
>
> I have already written something using wxPython directly so I have the
> basics (of my Python skills and the environment) OK I think.
>
> I am having a lot of troubl
On Fri, 24 Jul 2015 19:31:36 +0100, Paulo da Silva wrote:
[snip]
> Which technology is better?
> matplotlib?
> tkinter?
> wxwidgets?
> qt?
Sadly - I don't think wxpython has been ported to python3 yet.
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, 05 Aug 2014 20:06:05 +, Frank Miles wrote:
> I need to evaluate a complicated function over a multidimensional space
> as part of an optimization problem. This is a somewhat general problem
> in which the number of dimensions and the function being evaluated can
> vary
I need to evaluate a complicated function over a multidimensional space
as part of an optimization problem. This is a somewhat general problem
in which the number of dimensions and the function being evaluated can
vary from problem to problem.
I've got a working version (with loads of conditional
On Tue, 14 Jan 2014 07:26:10 -0800, ngangsia akumbo wrote:
> When i run this code on my pc it actually runs but signals that the app is
> not responding.
[snip most of the code]-
> def main():
> ex = wx.App()
> Example(None)
> ex.Mainloop()
>
>
> if __name__ == "__main__":
> m
On Thu, 12 Dec 2013 16:18:22 -0500, Larry Martell wrote:
> On Thu, Dec 12, 2013 at 11:51 AM, bob gailer wrote:
>> On 12/11/2013 9:07 PM, Larry Martell wrote:
>>
>>> Nope. Long before that I was working on computers that didn't boot when
>>> you powered them up, You had to manually key in a bootst
On Tue, 22 Oct 2013 16:40:32 +, Steven D'Aprano wrote:
> On Tue, 22 Oct 2013 15:39:42 +, Grant Edwards wrote:
>
>>> No, I was thinking of an array. Arrays aren't automatically
>>> initialised in C.
>>
>> If they are static or global, then _yes_they_are_. They are zeroed.
>
> Not that I
On Tue, 14 May 2013 08:05:53 -0700, Christian Jurk wrote:
> Hi folks,
>
> This questions may be asked several times already, but the development
> of relevant software continues day-for-day. For some time now I've been
> using xhtml2pdf [1] to generate PDF documents from HTML templates (which
> a
On Thu, 09 May 2013 23:35:53 +0800, chandan kumar wrote:
> Hi all,I'm new to python and facing issue using serial in python.I'm
> facing the below error
> ser.write(port,command)NameError: global name 'ser' is not defined
> Please find the attached script and let me know whats wrong in my scri
On 1/18/2013 7:32 PM, Roy Smith wrote:
Can whoever manages the mailing list block this bozo?
In article ,
kalvinmanual1 wrote:
I have solutions manuals to all problems and exercises in these textbooks. To
get one in an electronic format contact me at: kalvinmanual(at)gmail(dot)com
and let m
On Sunday, November 18, 2012 8:18:53 PM UTC-6, Mark Lawrence wrote:
> On 18/11/2012 19:31, Terry Reedy wrote:
>
> > The question was raised as to how much spam comes from googlegroups.
>
> I don't know the answer but I take the greatest pleasure in hurtling
> onto the dread googlegroups and gman
On Sunday, November 18, 2012 1:35:00 PM UTC-6, Terry Reedy wrote:
> The question was raised as to how much spam comes from googlegroups.
>
> Not all, but more that half, I believe. This one does.
>
>
>
> From: MoneyMaker
>
> ...
>
> Message-ID: <2d2a0b98-c587-4459-9489-680b1ddc4...@googlegro
On 10/9/2012 1:07 AM, Bob Martin wrote:
in 682592 20121008 232126 "Prasad, Ramit" wrote:
Thomas Bach wrote:=0D=0A> Hi there,=0D=0A> =0D=0A> On Sat, Oct 06, 2012 at =
03:08:38PM +, Steven D'Aprano wrote:=0D=0A> >=0D=0A> > my_tuple =3D my_=
tuple[:4]=0D=0A> > a,b,c,d =3D my_tuple if len(my_tu
On 9/16/2012 9:12 PM, Dave Angel wrote:
On 09/16/2012 09:07 PM, Jadhav, Alok wrote:
Hi Everyone,
I have a simple program which reads a large file containing few million
rows, parses each row (`numpy array`) and converts into an array of
doubles (`python array`) and later writes into an `hdf5
On 10/31/2012 4:38 PM, Mark Lawrence wrote:
On 31/10/2012 19:35, ru...@yahoo.com wrote:
On 10/31/2012 09:11 AM, Grant Edwards wrote:> On 2012-09-16,
?? wrote:.
"Broken"? Yes. But so is every piece of software in one way
or another. Thunderbird is one of the most perpetually bug
On 10/31/2012 2:35 PM, ru...@yahoo.com wrote:
On 10/31/2012 09:11 AM, Grant Edwards wrote:> On 2012-09-16, ??
wrote:
Iam positng via google groups using chrome, thats all i know.
Learn something else. Google Groups is seriously and permanently
broken, and all posts from Googl
On 9/16/2012 8:14 PM, alex23 wrote:
On Sep 17, 10:55 am, Roy Smith wrote:
They didn't buy the service. They bought the data. Well, they really
bought both, but the data is all they wanted.
I thought they'd taken most of the historical data offline now too?
Some of it, but they still had m
On 9/16/2012 10:44 AM, pandora.ko...@gmail.com wrote:
Whaen i tried to post just now by hitting sumbit, google groups told me that
the following addresssed has benn found in this thread! i guess is used them
all to notify everything!
cdf072b2-7359-4417-b1e4-d984e4317...@googlegroups.com
mailma
ple levels of quoting.
The incompatibility tends to insert a blank line after every line.
With multiple levels of quoting, this gives blank line groups that
often roughly double in size for every level of quoting.
Robert Miles
--
http://mail.python.org/mailman/listinfo/python-list
, not something you have much control over, except to stop
using Google Groups.
Could this mean that Google wants all the spam posted through Google
Groups to look obnoxious to the rest of Usenet that the spammers will go
elsewhere?
Robert Miles
--
http://mail.python.org/mailman/listinfo/python-list
uperminis. I'm not sure whether I still could,
though.
Robert Miles
--
http://mail.python.org/mailman/listinfo/python-list
On 7/25/2012 8:56 AM, andrea crotti wrote:
I have some long running processes that do very long simulations which
at the end need to write things on a database.
At the moment sometimes there are network problems and we end up with
half the data on the database.
The half-data problem is probably
On 7/26/2012 5:51 AM, Jaroslav Dobrek wrote:
And the cool thing is: you can! :)
In Python 2.6 and later, the new Py3 open() function is a bit more hidden,
but it's still available:
from io import open
filename = "somefile.txt"
try:
with open(filename, encoding="utf-8")
On 7/23/2012 1:10 PM, Dennis Lee Bieber wrote:
On Mon, 23 Jul 2012 16:42:51 +0200, Henrik Faber
declaimed the following in gmane.comp.python.general:
If that was written by my coworkers, I'd strangle them.
My first real assignment, 31 years ago, was porting an application
to CDC MP-
On 7/23/2012 11:18 AM, Albert van der Horst wrote:
In article <5006b48a$0$29978$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
Even with a break, why bother continuing through the body of the function
when you already have the result? When your calculation is done, it's
done, just
n has a version of Python available, in case you're interested.
Robert Miles
--
http://mail.python.org/mailman/listinfo/python-list
On 7/10/2012 1:08 PM, Demian Brecht wrote:
I also judge candidates on their beards
(http://www.wired.com/wiredenterprise/2012/06/beard-gallery/). If the beard's
awesome enough, no questions needed. They're pro.
You should hire me quickly, then, since I have a beard, already turning
partly gr
ery slowly - as in 5 minutes after I tell it to post.
Robert Miles
--
http://mail.python.org/mailman/listinfo/python-list
they get
that contains any HTML. This may be because Google Groups often
adds HTML even if you don't ask for it, and those servers want
to avoid the poor signal to noise ratio from Google Groups.
Robert Miles
--
http://mail.python.org/mailman/listinfo/python-list
s are moving toward newsgroups where no one
reports the spam.
Robert Miles
--
http://mail.python.org/mailman/listinfo/python-list
On 27/04/2012 5:57 a.m., Kiuhnm wrote:
On 4/26/2012 19:48, Paul Rubin wrote:
Roy Smith writes:
x = [a for a in iterable while a]
from itertools import takewhile
x = takewhile(bool, a)
I see that as a 'temporary' solution, otherwise we wouldn't need 'if'
inside of list comprehensions either
On Wed, 25 Apr 2012 23:03:36 +0200, Kiuhnm wrote:
> On 4/25/2012 22:05, Frank Miles wrote:
>> I have an exceedingly simple function that does a "named import". It
>> works perfectly for one file "r"- and fails for the second "x".
>>
>> If
I have an exceedingly simple function that does a "named import".
It works perfectly for one file "r"- and fails for the second "x".
If I reverse the order of being called, it is still "x" that fails,
and "r" still succeeds.
os.access() always reports that the file is readable (i.e. "true")
If I
ght you could apply the complex sort to each chunk before
>> writing it to disk, so each chunk was completely sorted, but then the
>> heapq.merge wouldn't work properly, because afaik you can only give it
>> one key.
>>
>> Any help much appreciated (I may well be missi
f obj is None: return None
return types.MethodType(self.im_func, obj, self.im_class)
# could alternately act like a callableproxy
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
ied it? I don't know of any reason that using sockets and
doing a packet capture would interfere with each other. What are you
trying to accomplish with the packet sniffing, though?
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 16, 2009, at 10:39 PM, Steven D'Aprano wrote:
On Wed, 16 Sep 2009 22:08:40 -0700, Miles Kaufmann wrote:
On Sep 16, 2009, at 9:33 PM, Steven D'Aprano wrote:
I have two threads, one running min() and the other running max()
over
the same list. I'm getting some mysteriou
,
encoding=sys.stdout.encoding,
errors='xmlcharrefreplace')
http://mail.python.org/pipermail/python-list/2009-August/725100.html
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
Python interpreter, but not necessarily to your application). But a
threaded approach is somewhat silly, since the GIL ensures that they
*won't* walk over the same list simultaneously (two separate lists,
for that matter).
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
not classes at all; they couldn't be
instantiated directly (from Python code), so you had to call the str()
function to create an object of type "string". I think there may have
been some discussion of renaming the built-ins to match PEP 8 for
Python 3, but if so I
comments that act as block
closers to your code, and can then use those comments to restore the
correct indentation to a mangled version. (Most forums offer some
sort of whitespace-preserving [code] tag, though; and pindent is
relatively old, and apparently not well maintained (no support
Teaching/Lectures/guido-intro-2.pdf
We're blessed with a variety of object-oriented almost-synonyms to
choose from, some of which are more Pythonic than others. But I don't
think it's worth "correcting" everyone who uses the phrase "class
variable", especially when their use of it causes no confusion.
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
The Python tokenization process is described here:
http://docs.python.org/reference/lexical_analysis.html
The tokenizer can't be expressed in terms of regular expressions,
because it's non-regular (thanks to things like matching nested braces
and keeping track of the indentation level
wing it via the python-list@ mailing
list. The list owners do a great job of keeping the level of spam at
a minimum, though there are occasional false positives (like your
post, apparently, since I'm only seeing the replies).
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 27, 2009, at 4:49 PM, kj wrote:
Miles Kaufmann writes:
Guido's design justifications:
http://mail.python.org/pipermail/python-dev/2000-November/010598.html
Ah! Clarity! Thanks! How did you find this? Did you know of
this post already? Or is there some special way to s
ace visible to nested
scopes at all. But it's better than the alternative of trying to
unify the class suite namespace and the class namespace, which would
be a nightmare of special cases (adding/deleting class attributes?
descriptors? __getattr__?) and require an implementation completel
the object reference name (a,b,c,d) from dk to use as input for
a file.
It sounds like you should either be storing that name as an attribute
of the object, or using a dictionary ({'a': a, 'b': b, ...}).
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
s 2 installer
debacle[1]). Leaving shell=False makes scripts more secure and
robust; besides, when I'm putting together a command and its
arguments, it's as convenient to build a list (['mycmd', 'myarg']) as
it is a string (if not more so).
-Miles
[1]: http://
but is this safe to do?
Or
are there strange side-effects I haven't seen yet?
In a diamond-inheritance situation, you may end up skipping methods
besides just B.method().
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
implementation.
If what you actually want is a stream of bytes, use BytesIO, which may
be seeked (sought?) however you please.
I'm basing this all on my reading of the Python source (and svn
history), since it doesn't seem to be documented, so take it with a
grain of salt.
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 21, 2009, at 8:08 PM, Ronn Ross wrote:
Hello I'm trying to read an xml file using minidome. The xml looks
like:
myProj
/here/
My code looks like so:
from xml.dom.minidom import parse
dom = parse("myfile.xml")
for node in dom.getElementsByTagName("project'):
p
On Jul 15, 2009, at 4:26 PM, David Bolen wrote:
Miles Kaufmann writes:
On Jul 14, 2009, at 5:06 PM, David Bolen wrote:
Are you sure? It seems to restrict them in the same block, but
not in
the entire file. At least I was able to use both space and tab
indented blocks in the same file
them all), which previously would have been
allowed, is now an error.
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
generates bytecode such that all references to that name within the
function will be looked up in the local scope only, including those
before the assignment statement.
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
... example it doesn't short-circuit.
No; like 'A or B', 'not (not A and not B)' does in fact short-circuit
if A is True. (The 'and' condition does not have to evaluate the
right operand when 'not A' is False.)
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
[snip]
Did I make twice the same obvious error ?
Try again with:
l = [('foo','bar'), ('foo', ''), ('', 'bar'), ('', '')]
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
eally see the
utility.
def xor2(a, b):
return (not b and a) or (not a and b)
def xor(*args):
return reduce(xor2, args)
You may also find this question interesting:
http://stackoverflow.com/questions/432842/
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
def func1():
...
while cond:
...
for x in commoncode():
yield x
...
See also:
- PEP 380: http://www.python.org/dev/peps/pep-0380/
- Stackless: http://www.stackless.com/
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
ameEx(), those opcodes that don't end in
goto fast_next_opcode are ticks.
Please correct me if _I'm_ wrong! :)
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
7;m aware of to
directly hook into function namespace access and manipulation.
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 30, 2009, at 6:46 AM, venutaurus...@gmail.com wrote:
I have to write an automted script which will test my c
program. That program when run will ask for the commands.
Keep in mind that, if your test script checks the program's output
before giving it input, you can run into pro
are others
out there, but it's usually the first recommended), rather than having
to search out and evaluate a dozen different ones.
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
to
work.
...
Notice that you are calling .group() on the match object instead
of .groups(). Without any arguments, .group() is equivalent
to .group(0), which means "return the entire matching string."
http://docs.python.org/library/re.html#re.MatchObject.group
-Mile
pretty much the bisect module in a nutshell. It manipulates a
sorted list using binary search.
With O(n) insertions and removals, though. A decent self-balancing
binary tree will generally do those in O(log n).
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
me(socket.gethostname())
If it throws a similar exception (Name or service not known), the root
problem may be a misconfiguration in your /etc/hosts or /etc/
resolv.conf files.
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
-test: on dirs ... ok (Important)
Verifying: fifo ... ok
Verifying: devices ... ok
Verifying: combo-tests ...
Sub-test: xattrs + rsrc forks ... ok
Sub-test: lots of metadata ... ok
-Miles
--
http://mail.python.org/mailman/listinfo/p
Perhaps, along with one of those gotchas, a mix of tabs and spaces are
used such that the second line only _appears_ to have a different
level of indentation? ;)
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
MethodType(self._func, cls if obj is None else obj, cls)
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
for b in _0:
yield (b, b)
baaz = list(_gen(iter(bar))
# PEP 227: "the name bindings that occur in the class block
# are not visible to enclosed functions"
class Foo(object):
bar = ['a', 'b', 'c']
def _gen(_0):
for b in _0:
yield (bar.index(b), b)
baaz = list(_gen(iter(bar))
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
ot;?
Those headers are added (by AbstractHTTPHandler.do_request_) only if
they are missing.
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
n a random floating point number N such that a <= N <= b
for a <= b
That's wrong. Where did you get it?
http://docs.python.org/library/random.html
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 9, 2009, at 6:05 AM, Diez B. Roggisch wrote:
Also as list-comps are going away and are replaced by
list()
Where did you hear that?
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
you the source.
Sounds like di(), which can be written:
import _ctypes
di = _ctypes.PyObj_FromPtr
def can(o): return str(id(o))
def uncan(s): return di(int(s))
http://www.friday.com/bbum/2007/08/24/python-di/
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
crowd:
from functools import partial
from operator import eq
from itertools import imap
def all_same(iterable):
it = iter(iterable)
return all(imap(partial(eq, it.next()), it))
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
You could try the python wrapper for OpenCV,
here is the link: http://code.google.com/p/ctypes-opencv/
Regards
Miles
--
http://mail.python.org/mailman/listinfo/python-list
gure out how it is done!
I believe those programs are able to do so because they are Finder
plugins--it's not something that a separate program could do. This
isn't really a Python question, though; you'd probably have better
luck finding answers on a OS X-related list.
-Mile
nsert the
parameters into the SQL query for you; it will look something like
this (though the exact details will vary depending on what module
you're using):
cursor.execute('INSERT INTO my_table VALUES (?, ?, ?)', ['test',1,'two'])
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
Clearly, any comparison with a boolean literal should be illegal. ;)
-Miles
P.S. ... really, though.
--
http://mail.python.org/mailman/listinfo/python-list
/
http://code.activestate.com/recipes/465156/
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
then skips over, whereas your version places items only
into the deque of the generator that needs it. However, for small n,
the tee-based solution has the advantage of having most of the work
done in C instead of in Python generator functions; in my limited
benchmarking, the point where your vers
yield i.next()
>
>
> This is like a zip, and can be re-written using itertools.izip.
>
> def mux(*iterables):
> for i in itertools.izip(*iterables):
> for item in i:
> yield item
In Python 2.6, you could also do this:
def mux(*iterables):
return iterto
mped. The demux should return a tuple of N generators.
from itertools import islice, tee
def demux(iterable, n):
return tuple(islice(it, i, None, n) for (i, it) in
enumerate(tee(iterable, n)))
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
'
else:
return None
return rlcompleter.Completer.complete(self, text, state)
readline.set_completer(TabCompleter().complete)
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
eld n
break
elif n % p == 0:
break
else:
raise Exception("Shouldn't have run out of primes!")
When generating the first 1000 primes, this version's approximately 20
times faster; for the first 10,000 primes, ~80x (but
t_hex does the long conversion)
> -- redefine __str__ and use %s
Or make your class a subclass of long.
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
vert to a flat sequence but rather a list tree. I don't
see the special case for dict views, at all.
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
ry/functions.html#__import__
But a far better solution is to fix your naming scheme—it's completely
illogical to have a Python module naming scheme where the names aren't
valid identifiers.
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
_to_float(x):
... return cast(ctypes.c_uint64(x), ctypes.c_double)
...
>>> float_to_int(5)
4617315517961601024
>>> bin(float_to_int(5))
'0b1010100'
>>> int_to_float(float_to_int(5) & float_to_int(10))
2.5
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
self._object)
# Define your own methods to wrap those of the object,
# or maybe define __getattr__
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
d to point out that A and B likely both inherit
from db.Model).
The Django solution is to allow forward references in the form of
strings of class names (e.g., ReferenceType('B')). It doesn't look
like App Engine has a solution for this situation:
http://code.google.com/p/goo
a FAQ:
http://effbot.org/zone/default-values.htm
http://www.python.org/doc/faq/general/#why-are-default-values-shared-between-objects
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Mar 13, 2009 at 3:13 PM, Miles wrote:
> [snip]
Sorry, didn't see the original thread on this.
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
2), (2, 4)]
b = [2, 4, 1, 3]
bdict = dict((v,k) for (k,v) in enumerate(b))
a.sort(key=lambda k: bdict[k[1]])
If you don't want to build the intermediary dict, a less efficient
version that runs in O(n^2):
a.sort(key=lambda k: b.index(k[1]))
Which is mostly similar to John's solutio
1 - 100 of 198 matches
Mail list logo