This assignment demonstrates how to use the import method to import from another script. I have created a measurement conversion app which asks the user for an integer value and then asks which formula he/she would like to convert from then to. The fuction is located on the 'lib_num.py' file where as the user input application is located on the 'main.py' file. For better user expirience, I have added the following message prompt:
Values available for conversion:
'cm to m' 'm to cm'
'cm to mm' 'mm to cm'
'mm to m' 'm to mm'
'ft to cm' 'ft to inch'
'inch to cm' 'inch to mm'
Enter the a numeric value:
-
First Python File: Utility File
- You can choose any name for this python file
- This file will be just a utility file (library) that contains a list of function(s), variables, etc..
- Contain at least one function (def …), with any name and any task.
- The function name should reflect the function job (don’t worry about using packages: from import for now)
- This file is only for creating the functions (We don’t call/run the function here), these will be called in another file which is the main python to run our application
- Hint: you can test your function(s) in this file by calling/running them inside this file, then you will need to delete the calling of your function
-
Second Python File: Main App File
- You can choose any name for this python file
- This file is the main one that represent our application and you will run in the terminal
- Using any one of the import commands (3 ways) to call or import the function(s) from your first python file
- Commit this folder to your GitHub account
- Add ReadMe file with some content about your simple challenge
- You will need to share with us your (Screen and Mic) and show us your code and the result