Ejemplo n.º 1
0
def get_clipboard_text_and_convert(paste_list=False):
    txt = GetClipboardText()
    if txt:
        if paste_list and '\t' in txt:
            array, flag = make_list_of_list(txt)
            if flag:
                txt = repr(array)
            else:
                txt = 'array(%s)' % repr(array)
            txt = ''.join([c for c in txt if c not in ' \t\r\n'])
    return txt
Ejemplo n.º 2
0
def get_clipboard_text_and_convert(paste_list=False):
    """Get txt from clipboard. if paste_list==True the convert tab separated 
    data to list of lists. Enclose list of list in array() if all elements are 
    numeric"""
    txt = GetClipboardText()
    if txt:
        if paste_list and "\t" in txt:
            array, flag = make_list_of_list(txt)
            if flag:
                txt = repr(array)
            else:
                txt = "array(%s)" % repr(array)
            txt = "".join([c for c in txt if c not in " \t\r\n"])
    return txt