def rm(self, filename):
try:<EOL><INDENT>self._ftp.delete(filename)<EOL><DEDENT>except error_perm:  <EOL><INDENT>try:<EOL><INDENT>current_folder = self._ftp.pwd()<EOL>self.cd(filename)<EOL><DEDENT>except error_perm:<EOL><INDENT>print('<STR_LIT>'<EOL>'<STR_LIT>' % (filename,))<EOL><DEDENT>else:<EOL><INDENT>self.cd(current_folder)<EOL>print('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>' % (filename,))<EOL><DEDENT><DEDENT>
Delete a file from the server.

        :param filename: the file to be deleted.
        :type filename: string