Firstly, I'd like to thank everyone for their help. I ended up throwing something together using dictionaries (because I understood those best out of what I had), that was a lot faster than my initial attempt, but have run into a different problem, that I was hoping for help with. So, what I have is all the subsequences that I was looking for in separate entries in the dictionary, and where each of them is found as the value. If a subsequence binds to more than one other item, I want to have the locations of the items all together. 
<br>The closest I&#39;ve been able to manage to get to what I want is this:<br><br>dict_of_bond_location = {}<br>dict1 = {&#39;AAA&#39;:[&#39;UUU&#39;], &#39;AAU&#39;:[&#39;UUG&#39;, &#39;UUA&#39;], &#39;AAC&#39;:[&#39;UUG&#39;], &#39;AAG&#39;:[&#39;UUC&#39;, &#39;UUU&#39;], &#39;CCC&#39;:[&#39;GGG&#39;]}
<br>dict2 = {&#39;AAA&#39;:[1], &#39;AAU&#39;:[2], &#39;AAC&#39;:[3], &#39;AAG&#39;:[0, 4], &#39;GGG&#39;:[10]}<br>dict3 = {&#39;UUU&#39;:[3, 5], &#39;UUG&#39;:[0], &#39;UUA&#39;:[1], &#39;UUC&#39;:[2], &#39;GGG&#39;:[14]}
<br><br><br>for key in dict2:<br>&nbsp;&nbsp;&nbsp; if key in dict1:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matching_subseq = dict1.get(key)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for item in matching_subseq:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if item in dict3:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location = dict3.get(item)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dict_of_bond_location.setdefault(key, []).append(location)
<br>print dict_of_bond_location<br><br>which gives this:<br>{&#39;AAU&#39;: [[0], [1]], &#39;AAG&#39;: [[2], [3, 5]], &#39;AAA&#39;: [[3, 5]], &#39;AAC&#39;: [[0]]}<br><br>but what I want is <br>&#39;AAU&#39;:[0, 1], &#39;AAG&#39;:[2, 3, 5], &#39;AAA&#39;:[3. 5], &#39;AAC&#39;:[0] 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>the setdefault(key, []).append(location) thing sort of does what I want, but I don&#39;t want the result to be a list of lists...just one big list. The production of a new dictionary is not necessary, but it made sense to me a few hours ago. Anyway, is there a fast and dirty way to add lists together, if the lists are not named (I think that&#39;s essentially what I want?)
<br><br>Thanks again,<br><br>Lauren<br><br><br><br><div><span class="gmail_quote">On 19/06/07, <b class="gmail_sendername"><a href="mailto:tutor-request@python.org">tutor-request@python.org</a></b> &lt;<a href="mailto:tutor-request@python.org">
tutor-request@python.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Send Tutor mailing list submissions to<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="mailto:tutor@python.org">tutor@python.org</a><br><br>To subscribe or unsubscribe via the World Wide Web, visit<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor
</a><br>or, via email, send a message with subject or body &#39;help&#39; to<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="mailto:tutor-request@python.org">tutor-request@python.org</a><br><br>You can reach the person managing the list at<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="mailto:tutor-owner@python.org">tutor-owner@python.org</a><br><br>When replying, please edit your Subject line so it is more specific<br>than &quot;Re: Contents of Tutor digest...&quot;<br><br><br>Today&#39;s Topics:
<br><br>&nbsp;&nbsp; 1. Re: iterating over a sequence question.. (Luke Paireepinart)<br>&nbsp;&nbsp; 2. Re: Help converting base32 to base16 (Alan Gauld)<br>&nbsp;&nbsp; 3. Re: Finding all locations of a sequence (fwd) (Danny Yoo)<br>&nbsp;&nbsp; 4. Re: sockets ( Linus Nordstr?m )
<br>&nbsp;&nbsp; 5. Re: sockets (Alan Gauld)<br>&nbsp;&nbsp; 6. Re: Finding all locations of a sequence (fwd) (Alan Gauld)<br>&nbsp;&nbsp; 7. Re: cannot pickle instancemethod objects (hok kakada)<br>&nbsp;&nbsp; 8. Re: Python and XSI (Vishal Jain)<br><br><br>----------------------------------------------------------------------
<br><br>Message: 1<br>Date: Mon, 18 Jun 2007 13:37:21 -0500<br>From: &quot;Luke Paireepinart&quot; &lt;<a href="mailto:rabidpoobear@gmail.com">rabidpoobear@gmail.com</a>&gt;<br>Subject: Re: [Tutor] iterating over a sequence question..
<br>To: &quot;Simon Hooper&quot; &lt;<a href="mailto:simon@partex.co.uk">simon@partex.co.uk</a>&gt;, <a href="mailto:tutor@python.org">tutor@python.org</a><br>Message-ID:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<a href="mailto:dfeb4470706181137x737f84b9l358a84c8c2043b16@mail.gmail.com">
dfeb4470706181137x737f84b9l358a84c8c2043b16@mail.gmail.com</a>&gt;<br>Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br><br>On 6/18/07, Simon Hooper &lt;<a href="mailto:simon@partex.co.uk">simon@partex.co.uk</a>
&gt; wrote:<br>&gt;<br>&gt; Hi Luke,<br>&gt;<br>&gt; * On 17/06/07, Luke Paireepinart wrote:<br>&gt; &gt; a more expanded version that accounts for either list being the longer<br>&gt; &gt; one, or both being the same length, would be:
<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;&gt;&gt;&gt; if len(t) &gt; len(l): x = len(t)<br>&gt; &gt; else: x = len(l)<br>&gt; &gt;&nbsp;&nbsp;&gt;&gt;&gt; print [(l[i%len(l)],t[i%len(t)]) for i in range(x)]<br>&gt; &gt; [(1, &#39;r&#39;), (2, &#39;g&#39;), (3, &#39;b&#39;), (4, &#39;r&#39;), (5, &#39;g&#39;)]
<br>&gt;<br>&gt; Being the duffer that I am, I&#39;m very pleased with myself that I came up<br>&gt; with a similar solution (albeit as a function rather than a list<br>&gt; comprehension) :)<br>&gt;<br>&gt; You do not need the if statement either,
<br><br><br>Yeah, I never knew about the max() function!<br>I noticed someone else used it in one of their solutions.<br>I&#39;m pretty sure I&#39;ve seen it a lot before, just didn&#39;t remember it.<br>-Luke<br>-------------- next part --------------
<br>An HTML attachment was scrubbed...<br>URL: <a href="http://mail.python.org/pipermail/tutor/attachments/20070618/1cf0ac67/attachment-0001.html">http://mail.python.org/pipermail/tutor/attachments/20070618/1cf0ac67/attachment-0001.html
</a><br><br>------------------------------<br><br>Message: 2<br>Date: Mon, 18 Jun 2007 21:12:02 +0100<br>From: &quot;Alan Gauld&quot; &lt;<a href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>&gt;<br>Subject: Re: [Tutor] Help converting base32 to base16
<br>To: <a href="mailto:tutor@python.org">tutor@python.org</a><br>Message-ID: &lt;<a href="mailto:f56oul$lah$1@sea.gmane.org">f56oul$lah$1@sea.gmane.org</a>&gt;<br>Content-Type: text/plain; format=flowed; charset=&quot;iso-8859-1&quot;;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reply-type=original<br><br><br>&quot;Jason Massey&quot; &lt;<a href="mailto:jason.massey@gmail.com">jason.massey@gmail.com</a>&gt; wrote<br><br>&gt;&nbsp;&nbsp;Nice entry at wikipedia:<br>&gt;<br>&gt; <a href="http://en.wikipedia.org/wiki/Base_32">
http://en.wikipedia.org/wiki/Base_32</a><br>&gt;<br><br>Thanks for the link, I should have thought of oooking there!<br>I&#39;ve heardof Base64 for encoding email but never come<br>across Base32 - any of the versions!<br>
<br>Alan G.<br><br><br><br>------------------------------<br><br>Message: 3<br>Date: Mon, 18 Jun 2007 16:54:53 -0400 (EDT)<br>From: Danny Yoo &lt;<a href="mailto:dyoo@cs.wpi.edu">dyoo@cs.wpi.edu</a>&gt;<br>Subject: Re: [Tutor] Finding all locations of a sequence (fwd)
<br>To: <a href="mailto:tutor@python.org">tutor@python.org</a><br>Message-ID: &lt;<a href="mailto:Pine.LNX.4.63.0706181653280.18230@cs.wpi.edu">Pine.LNX.4.63.0706181653280.18230@cs.wpi.edu</a>&gt;<br>Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
<br><br>Hi everyone,<br><br>Can someone help Lauren?&nbsp;&nbsp;I apologize for this, but I am very time<br>constrained at this moment, and won&#39;t be able to reply back for at least a<br>few hours.&nbsp;&nbsp;His question is below.&nbsp;&nbsp;Thanks!
<br><br><br>---------- Forwarded message ----------<br>Date: Mon, 18 Jun 2007 16:41:39 -0400<br>From: Lauren &lt;<a href="mailto:laurenb01@gmail.com">laurenb01@gmail.com</a>&gt;<br>To: Danny Yoo &lt;<a href="mailto:dyoo@cs.wpi.edu">
dyoo@cs.wpi.edu</a>&gt;<br>Subject: Re: [Tutor] Finding all locations of a sequence<br><br>Ok, these may be useful. I do have a potentially embarrassing problem,<br>however I will preface this with I&#39;m practically computer illiterate. Ok
<br>after I download the one you wrote (which I think I understand better than<br>the one listed previous...famous last words, I&#39;m sure), but when I ask to<br>import the ahocorasick module, it says it can&#39;t find it :( Is it possible to
<br>get step by step instructions on how to open the module? Do I need something<br>other than the latest download for it?<br>Again, I&#39;m not good at this programming thing, so I&#39;m sure I&#39;m missing<br>something obvious
<br><br>Thank you for your help,<br><br>Lauren<br><br>On 18/06/07, Danny Yoo &lt;<a href="mailto:dyoo@cs.wpi.edu">dyoo@cs.wpi.edu</a>&gt; wrote:<br>&gt;<br>&gt;<br>&gt;<br>&gt;&gt; Ok, what I have is a RNA sequence (about 5 million nucleotides
<br>&gt;&gt; [characters] long) and have (4100) subsequences (from another sequence)<br>&gt;&gt; and the sub-sequences are 6 characters long, that I want to find in it.<br>&gt;<br>&gt; Hi Lauren,<br>&gt;<br>&gt; I am positive that this problem has been tackled before.&nbsp;&nbsp;Have you talked
<br>&gt; to any of your fellow bioinformaticists?&nbsp;&nbsp;It might not be effective to ask<br>&gt; on Python-tutor because, for typical problems, regexes are sufficient.<br>&gt; For your particular scenario, regexes may not be, so you may want to ask
<br>&gt; specialists like those on the Biopython mailing lists:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://biopython.org/wiki/Mailing_lists">http://biopython.org/wiki/Mailing_lists</a><br>&gt;<br>&gt; It may seem like a simple extension of regular expression search, but as
<br>&gt; you may have noticed, feeding 4100 regex searches across that RNA sequence<br>&gt; is going to take some time.&nbsp;&nbsp;And trying to feed all of those subsequences<br>&gt; as a single regular expression (using ORs) is probably not going to work
<br>&gt; too well either: the engine has limitations on how large the pattern can<br>&gt; be before it starts behaving very badly.<br>&gt;<br>&gt;<br>&gt; To scale to this problem, we need to do something different.&nbsp;&nbsp;What you&#39;re
<br>&gt; probably looking for is more typically known as the keyword matching<br>&gt; problem, and there are algorithms specifically used for keyword matching.<br>&gt; For example, take a look at Nicholas Lehuen&#39;s Pytst package, which
<br>&gt; implements ternary search trees:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://nicolas.lehuen.com/index.php/category/Pytst">http://nicolas.lehuen.com/index.php/category/Pytst</a><br>&gt;<br>&gt; I&#39;ve also written a different package that uses the &quot;Aho-Corasick&quot;
<br>&gt; automata matcher, but to tell the truth I&#39;ve let the code stale a bit, and<br>&gt; can&#39;t support it (too busy with other work).&nbsp;&nbsp;But if you&#39;re interested in<br>&gt; tinkering with it, it&#39;s here:<br>
&gt; <a href="http://hkn.eecs.berkeley.edu/~dyoo/python/ahocorasick/">http://hkn.eecs.berkeley.edu/~dyoo/python/ahocorasick/</a>&lt;<a href="http://hkn.eecs.berkeley.edu/%7Edyoo/python/ahocorasick/">http://hkn.eecs.berkeley.edu/%7Edyoo/python/ahocorasick/
</a>&gt;<br>&gt; .<br>&gt;<br>&gt;<br>&gt; If you&#39;re going to do more string-matching stuff, I&#39;d recommend a look<br>&gt; into &quot;Algorithms on Strings, Trees, and Sequences&quot;.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521585198">
http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521585198</a><br>&gt;<br>&gt; It&#39;s one of the better books on bioinformatics string algorithms, and it<br>&gt; specifically covers this class of sequence-searching problems.
<br>&gt;<br><br><br><br>--<br>Lauren<br><br><a href="mailto:Laurenb01@gmail.com">Laurenb01@gmail.com</a><br><br><br>------------------------------<br><br>Message: 4<br>Date: Tue, 19 Jun 2007 01:19:45 +0200<br>From: &quot; Linus Nordstr?m &quot; &lt;
<a href="mailto:linusno@gmail.com">linusno@gmail.com</a>&gt;<br>Subject: Re: [Tutor] sockets<br>To: <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>Message-ID:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<a href="mailto:1eb3a0e10706181619r762bdacdqf64424148d0749dd@mail.gmail.com">
1eb3a0e10706181619r762bdacdqf64424148d0749dd@mail.gmail.com</a>&gt;<br>Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br><br>gusse i use this thread as my own little help thread.. :)<br><br>im having problem whit recv. It will not break the loop if ther are
<br>nothing more to recive. It dose recv all tit should, but then it go<br>another round in the loop and get stuck on recv, as far as print<br>debugging has showed,&nbsp;&nbsp;Dont realy know waht ells information i could<br>write sown to make my problem anny clrearer, so ask if anythin is
<br>unclear :)<br><br>And on another note, is there a way to use the self. less, it might be<br>just me but it looks rather ugly :)<br><br>def recive(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; all_data = []<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while 1:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.buf
 = self.s.recv(4096)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not self.buf: break<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; all_data.append(self.buf)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return all_data<br><br><br>On 6/18/07, Linus Nordstr?m &lt;<a href="mailto:linus@linusnordstrom.com">linus@linusnordstrom.com
</a>&gt; wrote:<br>&gt; Hello<br>&gt; I&#39;m trying to rewrite a chat-program i did in school this spring in<br>&gt; python, the school program was in java. All this to leran python.<br>&gt;<br>&gt; Anyway. I m trying to send a message using udp to a server that
<br>&gt; conntains the message 3 0 0 0, it has to be in network byte order and<br>&gt; unsigned. I have tried to send it like a string &quot;3000&quot; but get an<br>&gt; error message from the server saying that it did recive 4 bytes, but
<br>&gt; that it was an unknown message<br>&gt;<br>&gt; So what i am wondering is if there are anny special byte arrays, or<br>&gt; some thing i should use. or if there are anny other way than to send<br>&gt; the message than a string.
<br>&gt;<br><br><br>------------------------------<br><br>Message: 5<br>Date: Tue, 19 Jun 2007 00:34:28 +0100<br>From: &quot;Alan Gauld&quot; &lt;<a href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>&gt;
<br>Subject: Re: [Tutor] sockets<br>To: <a href="mailto:tutor@python.org">tutor@python.org</a><br>Message-ID: &lt;<a href="mailto:f574q7$tlr$1@sea.gmane.org">f574q7$tlr$1@sea.gmane.org</a>&gt;<br>Content-Type: text/plain; format=flowed; charset=&quot;iso-8859-1&quot;;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reply-type=original<br><br>&quot;Linus Nordstr?m&quot; &lt;<a href="mailto:linusno@gmail.com">linusno@gmail.com</a>&gt; wrote<br><br>&gt; im having problem whit recv. It will not break the loop if ther are<br>
&gt; nothing more to recive.<br><br>Take a look at the client side of the address book<br>example in my network profgramming topic. It shows<br>an example of breaking out of a recv loop.<br><br>Another option is to use the select module services
<br><br>&gt; And on another note, is there a way to use the self. less,<br>&gt; it might be just me but it looks rather ugly :)<br><br>No, it&#39;s good practice, it distinguishes between class level<br>variables and local variables. The use of self/this etc is usually
<br>required in industrial coding standards for C++ and Java<br>(eg Dept of defense/Government etc) for the same reason,<br>even though those languages don&#39;t require it. As in many<br>things python is simply enforcing what is already considered
<br>good practice elsewhere.<br><br>HTH,<br><br>--<br>Alan Gauld<br>Author of the Learn to Program web site<br><a href="http://www.freenetpages.co.uk/hp/alan.gauld">http://www.freenetpages.co.uk/hp/alan.gauld</a><br><br><br>
<br><br>------------------------------<br><br>Message: 6<br>Date: Tue, 19 Jun 2007 00:37:46 +0100<br>From: &quot;Alan Gauld&quot; &lt;<a href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>&gt;<br>Subject: Re: [Tutor] Finding all locations of a sequence (fwd)
<br>To: <a href="mailto:tutor@python.org">tutor@python.org</a><br>Message-ID: &lt;<a href="mailto:f5750e$u4o$1@sea.gmane.org">f5750e$u4o$1@sea.gmane.org</a>&gt;<br>Content-Type: text/plain; format=flowed; charset=&quot;iso-8859-1&quot;;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reply-type=original<br><br><br>&gt; From: Lauren &lt;<a href="mailto:laurenb01@gmail.com">laurenb01@gmail.com</a>&gt;<br>&gt; To: Danny Yoo &lt;<a href="mailto:dyoo@cs.wpi.edu">dyoo@cs.wpi.edu</a>&gt;<br>&gt; Subject: Re: [Tutor] Finding all locations of a sequence
<br>&gt;<br>&gt; after I download the one you wrote (which I think I understand<br>&gt; better than<br>&gt; the one listed previous...famous last words, I&#39;m sure), but when I<br>&gt; ask to<br>&gt; import the ahocorasick module, it says it can&#39;t find it :(
<br><br>You will need to ocate and download the module too.<br>Either store it along with your program or in the site-packages<br>folder in your python installation.<br><br>&gt; get step by step instructions on how to open the module?
<br><br>You just import it.<br>You can read more about that in my modules and functions topic<br>if that helps.<br><br>--<br>Alan Gauld<br>Author of the Learn to Program web site<br><a href="http://www.freenetpages.co.uk/hp/alan.gauld">
http://www.freenetpages.co.uk/hp/alan.gauld</a><br><br><br><br><br><br>------------------------------<br><br>Message: 7<br>Date: Tue, 19 Jun 2007 12:19:31 +0700<br>From: hok kakada &lt;<a href="mailto:hokkakada@khmeros.info">
hokkakada@khmeros.info</a>&gt;<br>Subject: Re: [Tutor] cannot pickle instancemethod objects<br>To: tutor-python &lt;<a href="mailto:tutor@python.org">tutor@python.org</a>&gt;<br>Message-ID: &lt;<a href="mailto:200706191219.32263.hokkakada@khmeros.info">
200706191219.32263.hokkakada@khmeros.info</a>&gt;<br>Content-Type: text/plain;&nbsp;&nbsp;charset=&quot;utf-8&quot;<br><br>?????? ??? 13 ?????? 2007 19:09, Kent Johnson ??????????????<br>&gt; hok kakada wrote:<br>&gt; &gt;&gt; What kind of object is matcher? Does it have any attributes that are
<br>&gt; &gt;&gt; functions? (Not methods you defined for the class, but functions or<br>&gt; &gt;&gt; methods that you assign to attributes of self.)<br>&gt; &gt;<br>&gt; &gt; Actually, I use the translate-toolkit from<br>
&gt; &gt; <a href="http://translate.sourceforge.net/snapshots/translate-toolkit-1.0.1rc1/">http://translate.sourceforge.net/snapshots/translate-toolkit-1.0.1rc1/</a><br>&gt; &gt; in translate/search/match.py:<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if comparer is None:
<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; comparer = lshtein.LevenshteinComparer(max_length)<br>&gt; &gt;<br>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.comparer = comparer<br>&gt; &gt;<br>&gt; &gt; I just found the problem that it is because of the LevenshteinComparer.
<br>&gt; &gt; Once I assign self.comparer = None, the I can dump the matcher<br>&gt; &gt; successfully. However, I still don&#39;t understand what could be wrong with<br>&gt; &gt; LevenshteinComparer.<br>&gt;<br>&gt; I think the problem is this code in LevenshteinComparer.__init__():
<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if Levenshtein:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.distance = self.native_distance<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.distance = self.python_distance<br>&gt;<br>&gt; which assigns an instance method to an instance attribute; this is the
<br>&gt; instancemethod that can&#39;t be pickled.<br>Ok...but how can we deal with it?<br><br>Kind Regards,<br>da<br><br><br>------------------------------<br><br>Message: 8<br>Date: Tue, 19 Jun 2007 12:08:36 +0400<br>From: &quot;Vishal Jain&quot; &lt;
<a href="mailto:vishal.thebigv@gmail.com">vishal.thebigv@gmail.com</a>&gt;<br>Subject: Re: [Tutor] Python and XSI<br>To: <a href="mailto:tutor@python.org">tutor@python.org</a><br>Message-ID:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<a href="mailto:5f3b7ddd0706190108y7ebe22ax2e859fb3760d1ee2@mail.gmail.com">
5f3b7ddd0706190108y7ebe22ax2e859fb3760d1ee2@mail.gmail.com</a>&gt;<br>Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br><br>Yes XSI is a 3D package from Avid. Also knows as Softimage|XSI<br><br>By everything failed I mean that XSI isnt registering Python resulting in I
<br>cant select scripitng langauge as Python inside XSI. After running the said<br>script the command prompt says &quot;Python:Registered&quot; but no error messages.<br><br>Yes XSI supports only ActiveX Scripts.<br><br>If everything goes good I expect to select scripting langauge as Python
<br>inside XSI and start scripting. But apparently eveything went good as per<br>the manuals and docs except my luck :(<br><br>I did search google but will search more as per your guidlines. And I am a<br>beginner too in Python. I never coded before.
<br><br>Thanks a lot for ur suggestions and concern.<br><br>By the way are you the same Alan Gauld who posts in XSI Base and CG Talk??<br><br>Vishal<br><br>Message: 6<br>Date: Mon, 18 Jun 2007 16:09:35 +0100<br>From: &quot;Alan Gauld&quot; &lt;
<a href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>&gt;<br>Subject: Re: [Tutor] Python and XSI<br>To: <a href="mailto:tutor@python.org">tutor@python.org</a><br>Message-ID: &lt;<a href="mailto:f5677j$e1f$1@sea.gmane.org">
f5677j$e1f$1@sea.gmane.org</a>&gt;<br>Content-Type: text/plain; format=flowed; charset=&quot;iso-8859-1&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reply-type=original<br><br>&quot;Vishal Jain&quot; &lt;<a href="mailto:vishal.thebigv@gmail.com">vishal.thebigv@gmail.com
</a>&gt; wrote<br><br>&gt; I am trying to get Python registered with XSI but<br>&gt; everything described in docs failed.<br><br>OK, I&#39;m assuming that XSI is the 3D Graphics software from Avid?<br><br>Can you tell us which docs and what exactly &#39;failed&#39; means?
<br>What did you do and what actually happened?<br>Any error messages?<br><br>&gt; C:\Python25\Lib\site-packages\win32comext\axscript\client\pyscript.py<br><br>ISTR that as being the script for registering Python as an<br>
Active Scripting language for WSH and the IE ActiveX engine.<br><br>I assume from that, that XSI uses active scripting?<br><br>What did you expect to happen after running it?<br>And what did happen?<br><br>&gt; still no luck. Is anybody else also facing the same situation? I am
<br>&gt; not very<br>&gt; sure how many people here uses Python for XSI but still hoping to<br>&gt; get some<br><br>I had to do a Google search...<br>You might have more luck on the main comp.lang.python list or<br>maybe even in the pyGame list. This group is for beginners to Python
<br>and XSI looks a tad advanced for most beginners, going by the couple<br>of pages I browsed. OTOH there is usually somebody here with an<br>interest in most things...<br><br>--<br>Alan Gauld<br>Author of the Learn to Program web site
<br><a href="http://www.freenetpages.co.uk/hp/alan.gauld">http://www.freenetpages.co.uk/hp/alan.gauld</a><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <a href="http://mail.python.org/pipermail/tutor/attachments/20070619/ded2eb30/attachment.htm">
http://mail.python.org/pipermail/tutor/attachments/20070619/ded2eb30/attachment.htm</a><br><br>------------------------------<br><br>_______________________________________________<br>Tutor maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a href="mailto:Tutor@python.org">
Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br><br><br>End of Tutor Digest, Vol 40, Issue 46<br>*************************************<br>
</blockquote></div><br><br clear="all"><br>-- <br>Lauren<br><br><a href="mailto:Laurenb01@gmail.com">Laurenb01@gmail.com</a>