Well, I have a lot to learn :)<br><br>Thank you very much both of you ! 
it seems to work now :p<br><br><div class="gmail_quote">2010/8/31 MRAB <span dir="ltr"><<a href="mailto:python@mrabarnett.plus.com">python@mrabarnett.plus.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 31/08/2010 20:20, Alban Nona wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Ok, here a solution:<br>
<br>
myFirstList = ["FN067_098_MEN", "FN067_098_JIN", "FN067_098_BG"]<br>
<br>
mySecondList =<br>
["FN067_098_MEN_Hair_PUZ_v001.0001.exr","FN067_098_JIN_Hair_SPC_v001.0001.exr","FN067_098_MEN_Jin_MVE_v001.0001.exr","FR043_010_GEN_NRM_v001.0001.exr"]<br>
<br>
for n in myFirstList:<br>
      var = str(n)<br>
</blockquote>
<br></div>
Why str(n)?<br>
<br>
Also, it would be clearer if you used different variables for the<br>
different loops.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
      for n in mySecondList:<br>
          if var in n:<br>
               mySecondList.remove(n)<br>
</blockquote>
<br></div>
You shouldn't change the length of a list over which you're iterating. Python will step along the list one entry at a time and won't notice when you remove an entry, so the next one will be skipped. For example:<br>

<br>
>>> letters = ["a", "b", "c", "d", "e"]<br>
>>> for i in letters:<br>
...     if i == "b" or i == "c":<br>
...         letters.remove(i)<br>
...<br>
>>> print letters<br>
['a', 'c', 'd', 'e']<br>
<br>
It removed "b" and then moved on to the next entry, which is "d"<br>
because "b" has been removed and all the following entries have moved<br>
down one place. It never sees "c".<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
print mySecondList<br>
<br>
</blockquote>
[snip]<div><div></div><div class="h5"><br>
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br>