Posts Tagged ‘Application’

Python: Coffee Consumption – P5

August 29, 2021 2 comments

Learning : Python, SQlite3, Dataset, Pandas,
Subject: Create Coffee Consumption Application.

[NOTE: To keep the code as simple as we can, We WILL NOT ADD any user input Varevecations. Assuming that our user will Enter the right inputs.]


In this part (Part-5) of Coffee Consumption App, we will write all three Function to manage the Coffee Size (Mug Size).

  • Create Function: Add New Coffee Size.
  • Create Function: Edit a Coffee Size.
  • Create Function: Delete a Coffee Size.

Beginning with adding new Coffee Size, we will ask the user to enter a New Coffee Size, then we simply added to the databasde using SQL Insert command. … Here is the Code ..

python project sql coffee consumption code ali radwani

The second Function in this part is to Edit a selected Coffee Size, so we will list-down all Sizes we have in the database, the user will select one (ID) then we will ask to enter the new one and update the database. Here is the code..

python project sql coffee consumption code ali radwani

Last Function in this part will be to Delete a selected Coffee Size, so again we will list all Coffee Sizes we have and will ask the user to select the one to be Deleted, then we execute the SQL command to Delete the record from the database… here is the code..

python project sql coffee consumption code ali radwani

What’s Coming: In Part-6 we will Start writing the Main Function to Add a Record of Coffee Consumption using the lookup tables data.

..:: Have Fun with Coding ::.. 🙂

Part 1 Part 2 Part 3 Part 4 Part 5
Part 6 Part – Part – Part – Part –

To Download my Python code (.py) files Click-Here

ali radwani python projects codeFollow me on Twitter..

By: Ali Radwani

Python: Orders Manager P1

August 20, 2019 Leave a comment

Orders Managment System
Subject: Outlines – P1

In last several posts we develop a Zoo Managment System [Click to Read]. We try to use our skills in python and pandas to work with DataFrame and developing easy app that reading and writeing a csv file. We will use the same principle and re-use most of it’s functions to write our new coming system.

The Story: I don’t think that there is any person using the web without using at least one of the online shopping sites, personally; I am using three sites. In coming posts we will work on Orders Managment System (OMS) to track our orders.

General Enhancement In the Zoo application we did not use any validation or try … Exceptions blocks, but this time we will use a range of validations over the user input starting from the menu until asking if the user want to save shange before he Quit. Using validations will make the code (or make it looks like) complicated, so I will use lots of comments to describe some codes.

Validation Example ..
In our Date entry, we will inform the user that we want the date as DD-MM-YYYY , then if the user enter any thing not logic (not a date) or say he enter “3/8-2019” our validation will convert that to “03-08-2019”.

OMS Outline: In this application our goal is to practices on data validation so we will develop a system to store our orders data and apply the validation on it, I will use aliexpress orders information to build the csv file. As far as i know, aliexpress site is not providing any tool to export a file that contain your orders detail so we will do this just to keep a history records of our orders.

File Structuer: The file will have 8 columns here is a short description of each column:
order_no: A serial number that will increment automatically, we will consider this to be a primary key of the table.
order_id: This is the order id generated by aliexpress site, we will enter it as it is.
order_date: To hold the orders date, the date will be in DD-MM-YYYY format.
order_detail: Short description of the order, even you write it in your words or copy paste it from your order page.
item_price: The price in US$
ship_price: Shipment amount in US$
quantity: The Quantity of the items.
item_url: The URL of the item page.

Coming Post We will start from next post to write the main menu, and the first function to create a csv file and insert the first row.

Follow me on Twitter..

Python Project: Armstrong Numbers

December 12, 2018 Leave a comment

Python: Armstrong Numbers

Check for Armstrong number in a range

In our last post (Check if a Number is Armstrong) we wrote a codes to check a given number and see whether it is an Armstrong or Not.

Today, we want to go through a set of numbers and see how many Armstrong numbers are there.

Before calling the ‘armstrong_in_range()’ and just to keep the code as less as we can, I assume the two numbers has the same number of digits, also I am getting the power (p) and the range numbers (n1, n2) out-side of this function and passing all as variables.

def armstrong_in_range(p,n1,n2):

my_sum = 0

count = 0

for num in range (n1,n2):


for arm in range(p):

my_sum = my_sum + ((num % 10)**p)

num = num // 10

if my_sum == tot:

print(‘\nThe number {} is Armstrong.’.format(tot))


count = count +1



print(‘\nWe have {} armstrong number(s)’.format(count))

Follow me on Twitter..

Python Project: Expenditure App Part 1

November 23, 2018 Leave a comment

Python Project:

Two months back I start to learn #Python “Python is a #computer #programming #language “, you can say it grabbed me very quickly. I start to read some #sample #code from the net, then downloading the requirement and after 10 working days I was writing #codes in python and doing what I love Solving #mathematics puzzles with #python’.

So I decide to contribute in training or publishing python language by posting some codes block with explaining and comments, also by developing an application so we will learn on a real example.

I am publishing some codes on my Twitter (@h_ta3kees):

and I will do the same here on my blog.

The coming posts will be about the application that we will start develop I will call it ‘Expenditure App’.