The above sollution didn't solve it but after f*cking around with it for some hours I got finally got it . def wiictrl(b, c, a0, adiv, accvis = '', degvis = '', rot = '', col = '', sca = ''): a = txt[b] a = float(a) #x signal smoothing c.append(a) if len(c) == 4: del ...