0% found this document useful (0 votes)
8 views

Python Project

Online shopping - mini project
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Python Project

Online shopping - mini project
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

MINI

PROJECT
ONLINE SHOPPING
AIM:
Python Project - ONLINE SHOPPING
This is a hypothetical website of our online shop to illustrate the
di erent components that make up a good online shopping website.

DESCRIPTION OF THE PROJECT:


This article explains an online shopping system implemented in
Python. The system allows users to sign up, log in, view available
products, place orders, and cancel orders. It also provides an admin
interface to manage the inventory and track income and loss.

KEY CONCEPTS:
The key concepts of the online shopping system are as follows:

User Authentication: Users can sign up with their email address and
password. The system securely stores the password using the MD5
hashing algorithm.

User Interface: The system provides a user interface for users to log
in, view available products, place orders, and cancel orders.
Admin Interface: The system provides an admin interface for
managing the inventory, including adding and removing items,
displaying the menu, and tracking income and loss.

Inventory Management: The system maintains an inventory of


products, including their IDs, names, availability, prices, and original
prices.

2
Order Placement: Users can place orders by selecting a product,
specifying the quantity, and confirming the order. The system
updates the availability of the product and calculates the total
amount.
Order Cancellation: Users can cancel orders by providing the order
ID. The system removes the order from the placed orders list.
Income and Loss Tracking: The system calculates the total income
or loss by subtracting the total cost of the products from the total
revenue.

CODE STRUCTURE:
adminLogin(): Displays the admin menu.
adminDisplayMenu(): Displays the inventory menu.
addItem(): Adds items to the inventory.
removeItem(): Removes an item from the inventory.
goods(): Displays the total available goods.
incomeLoss(): Calculates and displays the total income or loss.
adminChoice(): Handles the admin's choice and calls the
corresponding function.
userLogin(): Displays the user menu.
userDisplayMenu(): Displays the available products.
placeOrder(): Allows users to place an order.
cancelOrder(): Cancels a placed order.
userChoice(): Handles the user's choice and calls the
corresponding function.
signup(): Allows users to sign up.
login(): Allows users to log in.

3
main(): The main function that handles the login system
and menu options.

OVERVIEW OF THE SOFTWARE USED:


PYTHON: Python is a high-level, interpreted programming
language known for its readability, simplicity, and versatility.

1. Web Development: Python is a go-to for web development


with Django and Flask frameworks.
2. Data Science/Machine Learning: Python excels in data
science and machine learning using NumPy, pandas, TensorFlow,
and PyTorch.
3. Scientific Computing: Python is crucial for scientific tasks,
including data analysis and visualization with SciPy and Matplotlib.
4. Automation/Scripting: Python's simplicity makes it perfect
for automation and scripting across platforms.
5. Network Programming/DevOps: Python is widely used in
network programming and DevOps, featuring modules like requests
and tools like Ansible.

4
SOURCE CODE:

Python's hashlib module is not limited to just hashing strings – you


can also use it to hash larger data, such as files. This can be useful for a
variety of purposes, such as checking the integrity of a file or comparing
two files to see if they're identical.

1. List of products available for online shopping

2. Function block for admin login

5
3. Function block for admin display menu

4. Function block for adding items

5. Function block for removing an item.

6
6. Function block for the availability of goods

7. Function block for income or loss

7
8. Function block for admin choice

9. Function block for user login

10. Function block for user display menu

8
11. Function block for user id

12. Function block for placing order

9
13. Function block for canceling the order

14. Function block for user choice

10
15. Function block for signing up

11
16. Function block for login

12
17. Function block starting the usage of code

13
Output:

If choice 1 is selected for signing up this is the output for it

14
After signing in, the 4 options will appear. If the 1st option
is chosen, then this will be the output

15
If the 2nd one is chosen, then this will be the output

16
The menu is yet again displayed:

Option 4 logs you out of the website (python shell)

17
Once logged in as admin these 6 options will appear for
the admin to choose. When option 1 is selected, this will
be the output:

If the 2nd option is selected this will be the output

18
19
If the 3rd option is selected this will be the output

20
If the 4th choice is selected this will be the output

If the 5th choice is selected this will be the output

21
If the 6th log out is selected this will be the output

22
THANK YOU

23

You might also like