#NEWLINE# def unzip( zipfilename , destination ) : #NEWLINE# #INDENT# with zipfile . ZipFile ( zipfilename ) as zf : #NEWLINE# #INDENT# zf . extractall ( destination ) #NEWLINE# #UNINDENT# for ( root , ds , fs ) in os . walk ( '.' ) : #NEWLINE# #INDENT# if ( root == '.' ) : #NEWLINE# #INDENT# root_dir = os . path . join ( root , ds [ 0 ] ) #NEWLINE# ini_strip = ( len ( root_dir ) + 1 ) #NEWLINE# continue #NEWLINE# #UNINDENT# target = root [ ini_strip : ] #NEWLINE# for d in ds : #NEWLINE# #INDENT# source = os . path . join ( root , d ) #NEWLINE# destination = os . path . join ( target , d ) #NEWLINE# shutil . move ( source , destination ) #NEWLINE# #UNINDENT# for f in fs : #NEWLINE# #INDENT# source = os . path . join ( root , f ) #NEWLINE# destination = os . path . join ( target , f ) #NEWLINE# shutil . move ( source , destination ) #NEWLINE# #UNINDENT# if ( root != root_dir ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# shutil . rmtree ( root_dir )