Python question
Jan. 22nd, 2016 05:43 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
I am playing with code to learn Python moar, because I really learn better by using stuff than by trying to memorize abstract things, and even moar when it feels useful.
So yes.
It is going well except I'm trying to do a Thing which feels like it should feel simple except maybe I don't know the search term for what it's called or maybe in actual programming it's not simple? So I thought I'd ask the hive mind here and then if no luck maybe move on to Python forums hivemind or something.
Basically I am making a program that automates making a hat recipe, because I know a lot of math-phobic people who don't make up their own hat patterns because math.
I have a lot of the input features programmed and if/then boolean type stuff.
My conundrum is, I am looking for some sort of thing that goes something like:
here are several possible number of stitches to cast on; they work with a given pattern repeat, gauge, and head size (that coding is already done)
here are several integers (7, 8. 9, 10, 11, 12, let's say)
which of those integers go into the stitch totals with a remainder of zero?
give me those integers-cast on combos, that will be your choice of decreases-cast on pattern combos
(then I can insert it into a pre-scripted pattern text which is on Ravelry or something)
I've been looking at sets and conditional statements and lists and I started to look at regular expressions but by then my brain had hit "no more concentration for you tonight, also you keep snapping at people who interrupt your train of thought." so yup.
any feedback appreciated!
So yes.
It is going well except I'm trying to do a Thing which feels like it should feel simple except maybe I don't know the search term for what it's called or maybe in actual programming it's not simple? So I thought I'd ask the hive mind here and then if no luck maybe move on to Python forums hivemind or something.
Basically I am making a program that automates making a hat recipe, because I know a lot of math-phobic people who don't make up their own hat patterns because math.
I have a lot of the input features programmed and if/then boolean type stuff.
My conundrum is, I am looking for some sort of thing that goes something like:
here are several possible number of stitches to cast on; they work with a given pattern repeat, gauge, and head size (that coding is already done)
here are several integers (7, 8. 9, 10, 11, 12, let's say)
which of those integers go into the stitch totals with a remainder of zero?
give me those integers-cast on combos, that will be your choice of decreases-cast on pattern combos
(then I can insert it into a pre-scripted pattern text which is on Ravelry or something)
I've been looking at sets and conditional statements and lists and I started to look at regular expressions but by then my brain had hit "no more concentration for you tonight, also you keep snapping at people who interrupt your train of thought." so yup.
any feedback appreciated!