May-22-2019, 11:46 AM
What for?
Output of this line in bash:
is the same as output of this line in the python program posted above:
So I assume it works as expected.
The input you're suggesting to test is taking ages to compute in bash (by prepending it with 'echo'), and ages to compute in python code I posted because there's just too many combinations. I don't get what's your point...
Or did you mean to test
In such case I'd suggest to use subprocess to just execute it with bash using
Output of this line in bash:
echo {0,1,2}{0,1,2}
is the same as output of this line in the python program posted above:
string_combos('{0,1,2}{0,1,2}')
So I assume it works as expected.
'{0,1,2}'*15
in python evaluates to '{0,1,2}{0,1,2}{0,1,2}{0,1,2}{0,1,2}{0,1,2}{0,1,2}{0,1,2}{0,1,2}{0,1,2}{0,1,2}{0,1,2}{0,1,2}{0,1,2}{0,1,2}'
The input you're suggesting to test is taking ages to compute in bash (by prepending it with 'echo'), and ages to compute in python code I posted because there's just too many combinations. I don't get what's your point...
Or did you mean to test
'{0,1,2}*15'
(where *15 is included within the string)?In such case I'd suggest to use subprocess to just execute it with bash using
echo
.