CSV File Explorer and Reflection

by nemothefish260

02 Dec 2022

Link to my code https://trinket.io/python3/347f7a78a4

Reflection on the Writing Process

I think this CSV assignment took me the longest because I didn’t realize that we had the option of submitting it without necessarily checking all the boxes. I was however able to accomplish most of them as you can see my checked list below:

TODOS

x Feature: Put the interface in a while loop so that the user can do multiple things

x Feature: Create a new main menu option so that user can exit the program

x Refactor: Make selecting of columns_to_print a function, and call it

x Feature: Allow user to re-select which columns get printed

x Test: Ensure program uses new selected columns

#

x Refactor: Make creating the row_dicts_list into a function, and call it

x Feature: Use get_csv_filename to let the user select a new file

x Feature: Use the selected filename to create a new row_dicts_list

x Test: Ensure user is able to select ischools-messy.csv

x Feature: Adapt program to work as well as possible with ischools-messy.csv

I should note that I am confused by what exactly the Professor meant by ‘use the selected filename to create ‘a new row_dicts_list’, although my current code allows the user to select between the two files and use the same ‘row_dicts_list’ for both.

Confusions and Resolutions I was running into several errors until I came across a very basic explanation of the difference between variables and functions, which allowed me to manage the way I was naming variables or trying to change variables into functions more accurately. Going forward, I would like to revise my basics since I tend to forget concepts unless I have iterated them or at least seen someone visually execute them.

A piece of code that particularly tripped me up but got resolved by revisiting names is given below:

def get_row_dicts_list(filename): with open(filename) as file: reader = csv.DictReader(file) row_dicts_list = list(reader) return row_dicts_list row_dicts_list = get_row_dicts_list(filename)

print(row_dicts_list)

Adapting the code for the ischools-messy.csv file

I could not figure out how to perfectly adapt the program to the ischools-messy.csv file within the given time. At this time, my code asks the user if they want to select certain rows or columns but does not print columns for this file. It does, however, print specific and random rows.

Connecting this to my portfolio I found the challenge of creating a program with a main menu and then trying to refine it for the user extremeley relevant to my work as a UX/UI designer. I might try to work on this program or similar code and include the insights I have learnt about making interfaces user-friendly and accessible in my portfolio.

Usually, it is assumed that UX/UI is entirely disconnected from coding. However, this particular assignment makes me realize the potential advantage knowing code can facilitate as far as communicating with teams is concerned.

Hi! I am an ex-iterature major who is transitioning user design and research! Find nemothefish260 on Twitter, Github, and on the web.