# Coding for Veterans: Intermediate Python Assignment 1 # By: Mike Mawson # Due Date: 12 July 2020 # Finished: 11 July 2020 # Imports import csv def user_input(): choice = input('\nPlease choose...

1 answer below »
i've attached the assignment instructions plus the code for the 1st assignment that was done already. i need the myphp admin SQL file also so i can download it on my end and all the instructions that i might need to set up the program locally for myself. i will deal with the git logs on this end. i also have all the modules in pdf format if the expert needs them for reference


# Coding for Veterans: Intermediate Python Assignment 1 # By: Mike Mawson # Due Date: 12 July 2020 # Finished: 11 July 2020 # Imports import csv def user_input(): choice = input('\nPlease choose operation: \n \n 1 : Enter car details \n 2 : Exit') if choice == '1': make = input("Enter car make: ") model = input("Enter car model: ") year = int(input("Enter car year: ")) person = input("Enter sales person: ") price = float(input("Enter sales price: ")) car_details = {'Car Make': make, 'Car Model': model, 'Car Year': year, 'Sales Person': person, 'Sales Price': price} return car_details # if user chooses 2, exit program elif choice == '2': return {} else: raise Exception while True: try: # Take user input car_details = user_input() if car_details: # Read file and add details to it with open('carSales.csv', mode='a') as csv_file: fieldnames = ['Car Make', 'Car Model','Car Year','Sales Person','Sales Price'] writer = csv.DictWriter(csv_file, fieldnames=fieldnames) writer.writerow(car_details) print('Car Details Entered Successfully.\n') else: print('Exiting Program. Thank You.') break except IOError: print("I/O error: Error while opening CSV file.") break except (TypeError, ValueError): print('Enter correct values. Try Again.') continue except Exception as e: print('Please choose correct option.') continue Intermediate Python Assignment 4 Due Date: December 15st by 11:30PM The objective of every assignment is to make sure you practice what we learned throughout the modules to cement your learning. Every assignment is based on a real-life scenario to prepare you for a job in the industry. Assignment 4 covers topics that we will cover in modules 5,6, and 7. The car dealership from Assignment 1 is not happy with the Python console-based application that you have created and would like to upgrade a few features. Instead of utilizing the Python console to input the information, they would like their employees to have a GUI to enter the exact same information from assignment 1. Additionally, the dealership no longer wants to rely on a CSV file and wants to upgrade the program so that it stores all the information on a database. You must create text fields with labels (e.g., Car Make) so that the car dealership employee can input the relevant information. You must also create a submit button; that when clicked, the data is saved to a local database created in PHPMyAdmin. This means that you need to create a database table with the appropriate columns. Just like Assignment 3, you must screenshot the database table after you have added information to it using your Python program to prove that the program works! Deliverables: • Commented Python code file (.py) • Screenshot of the database (.png or .jpeg) • Screenshot of your git logs to prove that you have been utilizing git to backup your code throughout the development process. • As always, your files must be zipped into one zip file named studentNumber_studentName_Assignment4 and submitted via D2L by the deadline.
Answered Same DayJul 29, 2021

Answer To: # Coding for Veterans: Intermediate Python Assignment 1 # By: Mike Mawson # Due Date: 12 July 2020 #...

Sanghamitra answered on Jul 31 2021
148 Votes
62551/assignment4.py
import tkinter as tk
from tkinter import ttk
import mysql.connector
#mysql database connection
db = my
sql.connector.connect(
host='localhost',
user='root',
password='',
db='car_dealership'
)
#Cursor
cursor = db.cursor()
class Example:
def __init__(self):

#setup the window default property
window.title('Intermediate Python::Assignment 4')
window.geometry('500x400')
window.wm_minsize(150, 150)

#render form in window starts here
self.save_btn = ttk.Button(window, text='Save', command=self.save)
self.save_btn.place(x=400, y=365)
# Labels ------------------------------------------
self.make = ttk.Label(window, text='Enter car make:', width=90)
self.make.place(x=5, y=50 )
self.model = ttk.Label(window, text='Enter car model:')
self.model.place(x=5, y=100)
self.year = ttk.Label(window, text='Enter car year:',width=20)
self.year.place(x=5, y=150)

self.person = ttk.Label(window, text='Enter sales person:')
self.person.place(x=5, y=200)

self.price = ttk.Label(window,...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here