#title: Seed Stitch Sheet (python with knitout module) import knitout K = knitout.Writer('1 2 3 4 5 6'); K.addHeader('Machine', 'Kniterate'); #Parameters: min = 1 #needle number of left edge max = 20 #needle number of right edge rows = 20 #number of rows to knit carrier = "3" #carrier name # ---- set up initial loops and yarn carrier ---- #Bring in carrier: K.ingripper(carrier) #On Kniterate machines, carriers start on the left, #so will start tucking onto needles left-to-right, #and will be sure to tuck the leftmost needle in the first pass: for n in range(min, max+1, 1): #tuck alternating needles, making sure to do the left edge: if (n - min) % 2 == 0: K.tuck("+", 'f' + str(n), carrier) #now, moving right-to-left, tuck the needles that were not tucked on the first pass: for n in range(max, min-1, -1): if (n - min) % 2 != 0: K.tuck("-", 'f' + str(n), carrier) #knit three plain rows to allow cast-on stitches to relax: # three isn't set in stone here -- it's just convenient # for this example code to have the carrier end up on the right. for n in range(min, max+1, 1): K.knit("+", 'f' + str(n), carrier) for n in range(max, min-1, -1): K.knit("-", 'f' + str(n), carrier) for n in range(min, max+1, 1): K.knit("+", 'f' + str(n), carrier) # ---- seed stitch sheet ---- #Create a seed stitch (checkerboard of front- and back-knits) sheet. for r in range(0, rows+1, 1): if r % 2 == 0: #knit even rows with odd loops on the back: for n in range(min, max+1, 1): if (n-min) % 2 != 0: K.xfer('f' + str(n), 'b' + str(n)) for n in range(max, min-1, -1): if (n-min) % 2 == 0: K.knit("-", 'f' + str(n), carrier) else: K.knit("-", 'b' + str(n), carrier) #return odd loops to the front: for n in range(min, max+1, 1): if (n-min) % 2 != 0: K.xfer('b' + str(n), 'f' + str(n)) else: #knit odd rows with even loops on the back: for n in range(min, max+1, 1): if (n-min) % 2 == 0: K.xfer('f' + str(n), 'b' + str(n)) for n in range(min, max+1, 1): if (n-min) % 2 != 0: K.knit("+", 'f' + str(n), carrier) else: K.knit("+", 'b' + str(n), carrier) #return even loops to the front: for n in range(min, max+1, 1): if (n-min) % 2 == 0: K.xfer('b' + str(n), 'f' + str(n)) # ---- take carrier out and drop remaining loops ---- #Send carrier back to its parking location: K.outgripper(carrier) #drop loops: for n in range(min, max+1, 1): K.drop('f' + str(n)) K.write('seed-stitch-sheet.kniterate.k')