Efficient way of generating original alphabetic strings like unix file "split"

py_genetic conor.robinson at gmail.com
Thu Jun 14 14:41:01 EDT 2007


Hi,

I'm looking to generate x alphabetic strings in a list size x.  This
is exactly the same output that the unix command "split" generates as
default file name output when splitting large files.

Example:

produce x original, but not random strings from english alphabet, all
lowercase.  The length of each string and possible combinations is
dependent on x.  You don't want any repeats.

[aaa, aab, aac, aad, .... aax, ...... bbc, bbd, .... bcd]

I'm assumming there is a slick, pythonic way of doing this, besides
writing out a beast of a looping function.  I've looked around on
activestate cookbook, but have come up empty handed.  Any suggestions?

Thanks,
Conor




More information about the Python-list mailing list