Compare JS files and pick according to requirement
Since your post is a little unclear to me, I'm just going to point out a few small things that could be improved quiet a bit.


The program logic could be separated out into different functions. This allows for easy re-usability.
You should flesh out this program with comments for clarity. There are two types of comments, regular comments, and docstrings. Regular comments start with a # character, followed by a description. Docstrings describe functions and classes, like so.




def my_function(args):
    """
    This is a docstring. Put a description
    of your function here.
    """
    ...


class MyClass(object):
    """
    Put a description of your class here.
    """
    ...





You have some bad variable names, like ii, or tmp. Variable names should generally describe what the variable's purpose is.


There's not much for me to review, but if you want me to cover anything else, just mention it in the comments, and I'll see if I can cover it.