forked from LandGrey/pydictor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCHAR.py
27 lines (21 loc) · 884 Bytes
/
CHAR.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
# coding:utf-8
#
"""
Copyright (c) 2016-2017 LandGrey (https://github.com/LandGrey/pydictor)
License: GNU GENERAL PUBLIC LICENSE Version 3
"""
from __future__ import unicode_literals
import itertools
from lib.data.data import pyoptions
from lib.fun.fun import finishprinter, countchecker, range_compatible, finalsavepath, fun_name
def get_char_dic(objflag):
storepath = finalsavepath(fun_name())
countchecker(len(objflag), pyoptions.minlen, pyoptions.maxlen)
with open(storepath, "a") as f:
for i in range_compatible(pyoptions.minlen, pyoptions.maxlen+1):
for item in itertools.product(objflag, repeat=i):
if item:
f.write(pyoptions.operator.get(pyoptions.encode)(pyoptions.head + "".join(item) + pyoptions.tail) +
pyoptions.CRLF)
finishprinter(storepath)