Browse Source

*** empty log message ***

Dave Schuyler 20 years ago
parent
commit
17ee791ced
1 changed files with 15 additions and 0 deletions
  1. 15 0
      direct/src/showbase/PythonUtil.py

+ 15 - 0
direct/src/showbase/PythonUtil.py

@@ -471,6 +471,21 @@ def adjust(command = None, dim = 1, parent = None, **kw):
         vg.pack(expand = 1, fill = 'x')
         vg.pack(expand = 1, fill = 'x')
     return vg
     return vg
 
 
+def difference(a, b):
+    """
+    difference(list, list):
+    """
+    if not a: return b
+    if not b: return a
+    d = []
+    for i in a:
+        if (i not in b) and (i not in d):
+            d.append(i)
+    for i in b:
+        if (i not in a) and (i not in d):
+            d.append(i)
+    return d
+
 def intersection(a, b):
 def intersection(a, b):
     """
     """
     intersection(list, list):
     intersection(list, list):