<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def open_file(self, path):
 """ Creates a new GenericCodeEdit, opens the requested file and adds it to the tab widget. :param path: Path of the file to open """

        if path:
            editor = self.tabWidget.open_document(path)
            editor.cursorPositionChanged.connect(
                self.on_cursor_pos_changed)
            self.recent_files_manager.open_file(path)
            self.menu_recents.update_actions()