Hi William,
Oops, I forgot to post my reply to my own message. This is the solution I found, using the same GAP manual entry for PermList. def gap_format_cycles(x): """ Put a permutation in Gap format, as a string. """ x = str(x).replace(' ','') return x.replace('),(',')(').replace('[','').replace(']','') def gap_format_images(x): """ Put a permutation in Gap format, as a string. """ return "PermList(" + str(x) + ")" I hadn't yet sorted out how to preserve the "correct" cycle printing, as the __gap is used also for printing. This will be useful for creating transposition ciphers. --David --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---