This tool has been created for educational purposes only and is licensed under the MIT License. The python code was written by J. W.. It can be downloaded on GitLab, as well as a super (super) simple version. This documentation is maintained by Jakob Linnebank.
So, what does this tool do?
Basically, it takes a value and multiplies / divides this value with a factor based on the user’s input.
def getKey(list,value): return dict((v, k) for k, v in list.items())[value]
Okay I have no idea what this does
while True: [... code ...] quitCMD = input('Do you want to quit?\ny/n ') if quitCMD == 'y': break
As long as this operator is True, the program will restart itself. quitCMD asks for the user’s input, if the user enters ‘y’ the program quits.
#e print('\n') print('------- Unit Conversion Tool -------\n') print('For help type "help".')
print(’\n’) simply prints an empty line.
The other two prints simply print basic information
operationWanted = input('\n' + 'Do you want to view the list of possible unit conversions? \ny/n ')
This is the first input the user can enter.
If the input is ‘y’, it will call a function to print the next part.
operationWantedYes = '\nPossible units to choose from:\n[m] [dm] [cm] [mm] [miles] [yards] [leagues] [inches] [foots]'
This will be printed, if operationWanted is equal to ‘y’.
To be continued...
(Actually, I won't finish this as I only wanted to mess around with some markdown etc. [though the program indeed exists and can be downloaded but I won't maintain this documentation])