Python 练习册 => 0001 生成 200 个激活码

使用uuid模块生成随机数。随机uuid的重复几率极小,可忽略,适合作为激活码。这里使用uuid4()。 详见维基百科 以下为uuid模块说明(help(uuid)) This module provides immutable UUID objects (class UUID) and the functions uuid1(), uuid3(), uuid4(), uuid5() for ge