Still \'diving in\' to Python, and want to make sure I\'m not overlooking something. I wrote a script that extracts files from several zip files, and saves the extracted files t
if you don't care about readability, uuid.uuid4() is your friend.
import uuid def unique_filename(prefix=None, suffix=None): fn = [] if prefix: fn.extend([prefix, '-']) fn.append(str(uuid.uuid4())) if suffix: fn.extend(['.', suffix.lstrip('.')]) return ''.join(fn)