Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please add code that would allow this program to add or remove matching part numbers from inventory and update the existing data.csv file. the user

Please add code that would allow this program to add or remove matching part numbers from inventory and update the existing data.csv file. the user would then also have the option to write a written text note afterwards for future use that would go in the csv file. THANK YOU!!!

The csv file will be created when you run the program if one doesn't already exist. data.csv is going to be created by the user after they input some parts into the program,

You can do this however you want, redo my code or add to it.

image text in transcribed

import sys

part = [] row = [] col = [] tt = [] dt = []

def inf_input(): part.append(input("Please enter the part number: ") or '-') row.append(input("Please enter the part row location on the workflow rack: ") or '-') col.append(input("Please enter the part column location on the workflow rack: ") or '-') tt.append(input("Please enter the total count in stock: ") or '-') dt.append(input("Please enter the date in xx/xx/xxxx format: ") or '-')

def meum(): while True: print("----------------------") print("HID GLOBAL INVENTORY") print("----------------------") print("[1] INPUT PART INTO INVENTORY") print("[2] INPUT PART AND REMOVE PARTS FROM INVENTORY") print("[3] EXIT PROGRAM")

option = int(input("Enter your option: ")) if option == 1: inf_input() elif option == 2: #Place code that will add/or subtract quantity from inventory if the partnumbers entered are the same #with the option for the user to write a text comment for future reference. elif option == 3: df = pd.DataFrame({"PART NUMBER": part, "ROW NUMBER": row, "COLUMNS NUMBER": col, "TOTAL": tt, "DATE": dt}) df.to_csv('data.csv') print("EXITING PROGRAM.") break else: print("PLEASE ENTER A VALID OPTION!") continue

if __name__ == '__main__': meum()

import pandas as pd import sys part = [] row = 11 col = [] tt = [] dt = 0 def inf_input(): part.append(input ("Please enter the part number: ") or '-') row.append(input("Please enter the part row location on the workflow rack: ") or '-') col.append(input("Please enter the part column location on the workflow rack: ") or '-') tt.append(input("Please enter the total count in stock: ") or '-') dt.append(input ("Please enter the date in xx/xx/xxxx format: ") or '-') def meum(): while True: print(" print ("HID GLOBAL INVENTORY") ") print("---- print("[1] INPUT PART INTO INVENTORY") print("[2] INPUT PART AND REMOVE PARTS FROM INVENTORY") print("[3] EXIT PROGRAM") option = int (input ("Enter your option: ")) if option == 1: inf_input() elif option == 2: #Place code that will add/or subtract quantity from inventory if the partnumbers entered are the same #with the option for the user to write a text comment for future reference. elif option == 3: df = pd. DataFrame({ "PART NUMBER": part, "ROW NUMBER": row, "COLUMNS NUMBER": col, "TOTAL": tt, "DATE": dt}) df.to csv('data.csv') print ("EXITING PROGRAM.") break else: print ("PLEASE ENTER A VALID OPTION!") continue if name main : meum) import pandas as pd import sys part = [] row = 11 col = [] tt = [] dt = 0 def inf_input(): part.append(input ("Please enter the part number: ") or '-') row.append(input("Please enter the part row location on the workflow rack: ") or '-') col.append(input("Please enter the part column location on the workflow rack: ") or '-') tt.append(input("Please enter the total count in stock: ") or '-') dt.append(input ("Please enter the date in xx/xx/xxxx format: ") or '-') def meum(): while True: print(" print ("HID GLOBAL INVENTORY") ") print("---- print("[1] INPUT PART INTO INVENTORY") print("[2] INPUT PART AND REMOVE PARTS FROM INVENTORY") print("[3] EXIT PROGRAM") option = int (input ("Enter your option: ")) if option == 1: inf_input() elif option == 2: #Place code that will add/or subtract quantity from inventory if the partnumbers entered are the same #with the option for the user to write a text comment for future reference. elif option == 3: df = pd. DataFrame({ "PART NUMBER": part, "ROW NUMBER": row, "COLUMNS NUMBER": col, "TOTAL": tt, "DATE": dt}) df.to csv('data.csv') print ("EXITING PROGRAM.") break else: print ("PLEASE ENTER A VALID OPTION!") continue if name main : meum)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions