Created
August 17, 2012 00:39
-
-
Save tlehman/3374813 to your computer and use it in GitHub Desktop.
convert in to mm in triples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def mm(s): | |
| in_to_mm = lambda i: i*25.4 | |
| delim = " x " | |
| ss = s.replace(" ", "").lower().split(delim.replace(" ", "")) | |
| dims_in = map(float, ss) | |
| dims_mm = map(in_to_mm, dims_in) | |
| return reduce(lambda l,r: l+delim+r, map(str, dims_mm),"")[len(delim):-1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment