Table of Contents
- Libraries required
- Colorama
- TinyDb
- Difflib
- Datetime
- OS
- Pathlib
- Steps to install libraries
- Steps to create database
- Steps to create car list
- Steps to get file path
- To print colored text in terminal window.
- Install command:
pip install colorama
- To create and handle json database.
- Install command:
pip install tinydb
- To get close match of any name(here it is car name).
- Comes pre-installed with Python.
- To add date and time.
- Comes pre-installed with Python.
- To interact with operating system.
- Comes pre-installed with Python.
- To define path.
- Comes pre-installed with Python.
- Open command prompt.
- Enter install commands to install that library.
-
Steps to create json file
- Right click and select `New` option.
- Select `Text Document`.
- Rename the file with extension `.json`.
You need to create two text files for first time.
- One will have list of cars that are available to rent.
- Second will have list of cars that are currently rented.
- You may also create a third file to have a list of all cars.
- I have attached them for your referance.
- If you are running this programme for first time then cut and paste the contents of CarRented.txt to CarAvailable.txt.
- CarList.txt contains list of all cars.
- Right click on your desired file and select `Copy as path`.
- It will be copied something as `C:\Users\Alpha\Desktop\New Text Document.txt`.
- In program paste it as `C:\\Users\\Alpha\\Desktop\\New Text Document.txt`.