Archive

Posts Tagged ‘Application’

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..





Advertisements

Python Project

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):

tot=num

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))

my_sum=0

count = count +1

else:

my_sum=0

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



Follow me on Twitter..

Python Project

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):

https://twitter.com/h_ta3kees?s=09

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’.