def copy_without_prompts ( self ) : text = self . get_selected_text ( ) lines = text . split ( os . linesep ) for index , line in enumerate ( lines ) : if line . startswith ( '>>> ' ) or line . startswith ( '... ' ) : lines [ index ] = line [ 4 : ] text = os . linesep . join ( lines ) QApplication . clipboard ( ) . setText ( text )
pasting data from clipboard in python
Copy text to clipboard without prompts
def copy_without_prompts(self):
        """Copy text to clipboard without prompts"""
        text = self.get_selected_text()
        lines = text.split(os.linesep)
        for index, line in enumerate(lines):
            if line.startswith('>>> ') or line.startswith('... '):
                lines[index] = line[4:]
        text = os.linesep.join(lines)
        QApplication.clipboard().setText(text)