Add missing clean-str-dups script
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
bd3ac133ac
commit
5d6332af70
1 changed files with 24 additions and 0 deletions
24
bin/clean-str-dups.py
Executable file
24
bin/clean-str-dups.py
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def main(args):
|
||||
sep = args[1]
|
||||
in_str = args[2]
|
||||
out = []
|
||||
|
||||
[
|
||||
out.append(i)
|
||||
for i in in_str.split(sep)
|
||||
if not out.count(i)
|
||||
]
|
||||
|
||||
print(sep.join(out))
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main(sys.argv))
|
Loading…
Reference in a new issue