Note that there are some explanatory texts on larger screens.

plurals
  1. POPython sort unique list of lists' items
    primarykey
    data
    text
    <p>I can't seem to find a question on SO about my particular problem, so forgive me if this has been asked before!</p> <p>Anyway, I'm writing a script to loop through a set of URL's and give me a list of unique urls with unique parameters.</p> <p>The trouble I'm having is actually comparing the parameters to eliminate multiple duplicates. It's a bit hard to explain, so some examples are probably in order:</p> <p>Say I have a list of URL's like this</p> <ul> <li>hxxp://www.somesite.com/page.php?id=3&amp;title=derp</li> <li>hxxp://www.somesite.com/page.php?id=4&amp;title=blah</li> <li>hxxp://www.somesite.com/page.php?id=3&amp;c=32&amp;title=thing</li> <li>hxxp://www.somesite.com/page.php?b=33&amp;id=3</li> </ul> <p>I have it parsing each URL into a list of lists, so eventually I have a list like this:</p> <pre><code>sort = [['id', 'title'], ['id', 'c', 'title'], ['b', 'id']] </code></pre> <p>I nee to figure out a way to give me just 2 lists in my list at that point:</p> <pre><code>new = [['id', 'c', 'title'], ['b', 'id']] </code></pre> <p>As of right now I've got a bit to sort it out a little, I know I'm close and I've been slamming my head against this for a couple days now :(. Any ideas?</p> <p>Thanks in advance! :)</p> <p>EDIT: Sorry for not being clear! This script is aimed at finding unique entry points for web applications post-spidering. Basically if a URL has 3 unique entry points</p> <pre><code>['id', 'c', 'title'] </code></pre> <p>I'd prefer that to the same link with 2 unique entry points, such as:</p> <pre><code>['id', 'title'] </code></pre> <p>So I need my new list of lists to eliminate the one with 2 and prefer the one with 3 ONLY if the smaller variables are in the larger set. If it's still unclear let me know, and thank you for the quick responses! :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload