1 # Module 'util' -- some useful functions that don't fit elsewhere
3 # NB: These are now built-in functions, but this module is provided
4 # for compatibility. Don't use in new programs unless you need backward
5 # compatibility (i.e. need to run with old interpreters).
8 # Remove an item from a list.
9 # No complaints if it isn't in the list at all.
10 # If it occurs more than once, remove the first occurrence.
12 def remove(item
, list):
13 if item
in list: list.remove(item
)
16 # Return a string containing a file's contents.
19 return readopenfile(open(fn
, 'r'))
22 # Read an open file until EOF.