Skip to content
← Back to Community
Magic Converter: #WEEKLY ...14?
Profile icon
CodeLongAndPros

This is my converter app.
It has two modes:

  • Single-value
  • Bulk

Please use repl.run

Single mode

In single mode, you can select your units and value interactively.

Your available units are:

  • Feet
  • Inches
  • Jimmy Griffin Snow Index (4 inches)
  • Wiffles (3.5 inches)

Once you do that, the value will be exported to the display.

Bulk mode

Bulk mode requires that you open a file and edit it to contain one value per line.
For example:

2 3 1 5 4

You'll also have to enter a formula to convert the values, with $1 representing the current value being applied.

To convert the values above to inches, use $1*12.

After the conversion is complete, they will be saved to {filename}_converted.

And that's it, for the magic converter

Voters
Profile icon
GriffinPerkins
Profile icon
TheForArkLD
Profile icon
gibbsfreenergy
Profile icon
InvisibleOne
Profile icon
CodeLongAndPros
Comments
hotnewtop
Profile icon
TheDrone7

SCORED.

Profile icon
TheForArkLD

Cool!
Can you add japanese units?

Profile icon
CodeLongAndPros

@TheForArkLD No, but you can use the bulk converter to do so…

Profile icon
gibbsfreenergy

Ur a mod? I never knew that!

Profile icon
CodeLongAndPros

@JosephSanthosh I didn't either, until a day ago.

Profile icon
gibbsfreenergy

Wait really?!? WOW!! [email protected]

Profile icon
gibbsfreenergy

Where do you learn this from?

Profile icon
CodeLongAndPros

@JosephSanthosh
What's this?

Profile icon
gibbsfreenergy

This calculator! How do you all remember do these things?!? @CodeLongAndPros

Profile icon
CodeLongAndPros

@JosephSanthosh
Like in->ft?

Profile icon
gibbsfreenergy

No how do you remember what to code and when? Isn't so confusing @CodeLongAndPros

Profile icon
CodeLongAndPros

@JosephSanthosh
Well, for the npyscreen stuff, I have a tab open with the docs, and with the other stuff, I’ve just memorized it.

Profile icon
CodeLongAndPros

@JosephSanthosh It’s like reading music, you just kinda know when you see it (or think it)

Profile icon
gibbsfreenergy

Wow! Thats so cool! How long have you been coding? @CodeLongAndPros

Profile icon
CodeLongAndPros

@JosephSanthosh About three years

Profile icon
gibbsfreenergy

Wow! Are you a highschooler? @CodeLongAndPros

Profile icon
CodeLongAndPros

@JosephSanthosh In secondary, yes.

Profile icon
gibbsfreenergy
Profile icon
InvisibleOne

Nice!

Profile icon
CodeLongAndPros
Profile icon
InvisibleOne