단어 생성기를 사용하여 단어 생성기를 만들고 각 항목을 파일에 쓰려고하는데, 파일 출력시 파일에 쓸 때 나는yield를 가진 단어 생성기 만들기
C sh t d t d t d d � d d � �< } x2 t | j � � | k r] | j t t � � � q, WWd QXd S( Ns bfDict-t
use_stringt lengthi
s .txts a+( t openR t Truet lent readlinest writet nextR ( t max_wordst lib( ( s[ C:\Users\z-perkins-thomas\Documents\bin\python\HashKing\lib\attacks\bruteforce\bf_attack.pyt create_wordlist s )(
t ost stringt randomR t lib.algorithms.hashing_algst lib.settingsR t FalseR R ( ( ( s[ C:\Users\z-perkins-thomas\Documents\bin\python\HashKing\lib\attacks\bruteforce\bf_attack.pyt <module> s
l2\colorlog\colorlog\logging.pyt wrapper s
( t functoolst wraps( R R ( ( R sT c:\users\z-perk~1\appdata\local\temp\1\pip-build-rtaul2\colorlog\colorlog\logging.pyt ensure_configured s ( t __doc__t
__future__R R R t colorlog.colorlogR R R R R t getLoggert debugt infot warningt errort criticalt logt exceptiont
StreamHandler( ( ( sT c:\users\z-perk~1\appdata\local\temp\1\pip-build-rtaul2\colorlog\colorlog\logging.pyt <module> s"
s" C:\Python27\lib\ctypes\wintypes.pyR g s t _COORDc B s e Z d e f d e f g Z RS( t Xt Y( R R R R ( ( ( s" C:\Python27\lib\ctypes\wintypes.pyR n s t POINTc B s e Z d e f d e f g Z RS( t xt y( R R R R ( ( ( s" C:\Python27\lib\ctypes\wintypes.pyR r s t SIZEc B s e Z d e f d e f g Z RS( t cxt cy( R R R R ( ( ( s" C:\Python27\lib\ctypes\wintypes.pyR w s c C s | | d >| d >S( Ni i ( ( t redt greent blue( ( s" C:\Python27\lib\ctypes\wintypes.pyt RGB| s t FILETIMEc B s e Z d e f d e f g Z RS( t
dwLowDateTimet dwHighDateTime( R R t DWORDR ( ( ( s" C:\Python27\lib\ctypes\wintypes.pyR% s t MSGc B sD e Z d e f d e f d e f d e f d e f d e f g Z RS( t hWndt messaget wParamt lParamt timet pt( R R t HWNDt c_uintt WPARAMt LPARAMR( R R ( ( ( s" C:\Python27\lib\ctypes\wintypes.pyR) � s i t WIN32_FIND_DATAAc B sp e Z d e f d e f d e f d e f d e f d e f d e f d e f d e e f d e d
f g
Z RS( t dwFileAttributest ftCreationTimet ftLastAccessTimet ftLastWriteTimet
nFileSizeHight nFileSizeLowt dwReserved0t dwReserved1t cFileNamet cAlternateFileNamei ( R R R( R% t c_chart MAX_PATHR ( ( ( s" C:\Python27\lib\ctypes\wintypes.pyR4 � s
t WIN32_FIND_DATAWc B sp e Z d e f d e f d e f d e f d e f d e f d e f d e f d e e f d e d
f g
Z RS( R5 R6 R7 R8 R9 R: R; R< R= R> i ( R R R( R% t [email protected] R ( ( ( s" C:\Python27\lib\ctypes\wintypes.pyRA � s
t ATOMt BOOLt BOOLEANt BYTEt CO
내 생성은 다음과 같습니다
import itertools
def word_generator(length_min=6, length_max=12, perms=False):
chrs = 'abc'
for n in range(length_min, length_max + 1):
for xs in itertools.product(chrs, repeat=n):
yield ''.join(xs)
def create_wordlist(max_words=100000):
with open("words.txt", "a+") as lib:
while len(lib.readlines()) <= max_words:
lib.write(next(word_generator()))
는이 파일에 이상한 출력의 원인은 무엇입니까?
텍스트 편집기 나 쉘의 인코딩이 ASCII 인코딩과 호환의 인코딩으로 설정 될 수있다 :