def copy_file_without_comments(source, destination):
 with open(source, 'r') as infile:
  with open(destination, 'w') as outfile:
   for line in infile:
    if (not (line.isspace() or line.lstrip().startswith('#'))):
     outfile.write(line)

def copy_file_without_comments ( source , destination ) : with open ( source , 'r' ) as infile : with open ( destination , 'w' ) as outfile : for line in infile : if ( not ( line . isspace ( ) or line . lstrip ( ) . startswith ( '#' ) ) ) : outfile . write ( line )
copies source to destination .