Skip to content

A Python script and module for generating permutations of a string

License

Notifications You must be signed in to change notification settings

xJrJackBlack/permutatify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

permutatify

A Python script and module for generating permutations of a string

script

Script usage:

usage: permutatify.py [-h] gen_string

generate a list of permutated values

positional arguments:
  gen_string  input [["a", "b"], ["c", "d"]] will generate ac, ad, bc, bd

optional arguments:
  -h, --help  show this help message and exit

Example input:

./permutatify.py "[['correct', 'wrong'], ['battery'], ['', ' '], ['staple', 'pencil']]"

Example output:

correctbatterystaple
correctbatterypencil
correctbattery staple
correctbattery pencil
wrongbatterystaple
wrongbatterypencil
wrongbattery staple
wrongbattery pencil

module

Simply copy over the permutate module folder and import it:

from permutate import permutate

The API is as so:

permutate(list_of_lists, initial_reduce_value)
permutate([['correct', 'wrong'], ['battery'], ['', ' '], ['staple', 'pencil']], [''])

See test.py for more examples.

license

See LICENSE

About

A Python script and module for generating permutations of a string

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%