Advertisement
Guest User

Python CSV Script

a guest
Apr 12th, 2023
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.96 KB | None | 0 0
  1. import csv
  2. import os
  3.  
  4. # Define the sub-options
  5. wood_options = ['Red Oak', 'Brown Maple', 'Cherry', 'Hard Maple', 'Hickory', 'Rustic Hickory', 'Rustic Cherry', 'Sap Cherry', 'Rustic Walnut', 'Clean Walnut']
  6. size_options = ['42" Wide x 60" Long', '42" Wide x 66" Long', '42" Wide x 72" Long', '48" Wide x 60" Long', '48" Wide x 66" Long', '48" Wide x 72" Long']
  7. leaves_options = ['Solid Top', '1-12" Leaf with Skirting (self storable)', '2-12" Leaves with Skirting (self storable)', '3-12 Leaves with Skirting', '4-12" Leaves with Skirting', '3-12 Leaves (1 leaf with skirting, 1 without, self storable)', '4-12 Leaves (2 leaf with skirting, 2 without, self storable)']
  8. edge_options = ['Mission', 'Beveled', 'Waterfall', 'Chamfer', 'Ogee', 'Round Over']
  9. height_options = ['30" High (Dining/Kitchen)', '36" High (Counter/Island)']
  10. thickness_options = ['1" Thick', '1 ¼" Thick', '1 ½" Thick', '1 ⅜" Thick', '1 ¾" Thick']
  11. finish_options = ['Acres (D22R00973) - Cat. 1','Almond (FC 42000) - Cat. 1','American Antique (FC 48024) - Cat. 1','Antique Slate (FC 19852) - Cat. 1','Asbury Brown (FC 7992) - Cat. 1','Bel Air (FC 47823) - Cat. 1','Briar (FC 15743) - Cat. 1','Burnt Umber (FC 10748) - Cat. 1','Carbon (FC 50240) - Cat. 1','Chalk (PCL 176) - Cat. 2','Charwood (FC 50241) - Cat. 1','Chestnut (FC 104) - Cat. 1','Creek Slate (D22N10189) - Cat. 1','Dark Knight (FC 49908) - Cat. 1','Driftwood (FC 11434) - Cat. 1','Earthtone (FC 40592) - Cat. 1','Ebony (FC 11047) - Cat. 1','Flint (FC 51263) - Cat. 1','Golden Harvest (FC 46483) - Cat. 1','Golden Pecan (FC 41610) - Cat. 1','Grey Flannel (FC 47865) - Cat. 1','Harvest (FC 107) - Cat. 1','Honey (CF-921S-2) - Cat. 1','Hoosier Special (FC 11043) - Cat. 1','India Ink (FC 47867) - Cat. 1','Indigo (FC 47866) - Cat. 1','Lemon (D22Y00320) - Cat. 1','Limed (D22CW00148) - Cat. 1','Lite Asbury (FC 14620) - Cat. 1','Manchester (FC 42633) - Cat. 1','Medium Walnut (FC 44688) - Cat. 1','Michael’s Cherry - Cat. 1','Mineral (PCL 175) - Cat. 2','Muted Black (PCL 182) - Cat. 1','Muted Grey (PCL 181) - Cat. 1','Muted White (PCL 183) - Cat. 1','Natural - Cat. 1','Oatmilk (PCL 180) - Cat. 2','Old Museum (FC 47276) - Cat. 1','Onyx (FC 230) - Cat. 1','Sand (D22N10202) - Cat. 1','Sandstone (D22N08963) - Cat. 1','Scarlet (FC 49909) - Cat. 1','Sealy (FC 44938) - Cat. 1','Seashell (D22N09096) - Cat. 1','Shadow (FC 24427) - Cat. 1','Smoke (D22N10069) - Cat. 1','Tavern (FC 10944) - Cat. 1','Vintage Antique (FC 17882) - Cat. 1','Ashley (PCL 174) - Cat. 2','Almond Burnished (FC 42000) - Cat. 2','Carbon Burnished (FC 50240) - Cat. 2','Michael’s Cherry Burnished - Cat. 2','Tavern Burnished (FC 10944) - Cat. 2','Distressed #61Black /Mike’s Rub - Cat. 3','Distressed Weathered Asphalt (PCL 178) - Cat. 3','Distressed Weathered Black (SP 151) - Cat. 3','Distressed Weathered Burlap (PCL 186) - Cat. 3','Distressed Weathered Grey Wood (SP 159) - Cat. 3','Distressed Weathered Hazelnut (PCL 185) - Cat. 3','Distressed Weathered Iron (PCL 179) - Cat. 3','Distressed Weathered Log (SP 160) - Cat. 3','Distressed Weathered Rockledge (PCL 187) - Cat. 3','Distressed Weathered Savanna (PCL 189) - Cat. 3','Distressed Weathered Smog (PCL 177) - Cat. 3','Distressed Weathered Tortilla (PCL 188) - Cat. 3','Distressed Weathered Treebark (SP 166) - Cat. 3','Distressed Worn Spice (SP 156) - Cat. 3','No Distressed Weathered Asphalt (PCL 178) - Cat. 3','No Distressed Weathered Iron (PCL 179) - Cat. 3','No Distressed Weathered Smog (PCL 177) - Cat. 3','No Distressed Weathered Treebark (SP 166) - Cat. 3','Weathered Beige (SP 168) - Cat. 3','Weathered Greek Villa (PCL 184) - Cat. 3','Weathered Greystone (SP 171) - Cat. 3','Weathered Snow White (SP 170) - Cat. 3','Weathered Tusk (SP 167) - Cat. 3','Accessible Beige (RNC 1091) - Cat. 2','Black - Cat. 2','Bright White (FP W0117) - Cat. 2','Chelsea Grey (FP 22638) - Cat. 2','Country White (FP 5155) - Cat. 2','Icicle (RNC 1003) - Cat. 2','Metropolitan (FP 15809) - Cat. 2']
  12.  
  13. # Create the list of options, which is a list of lists
  14. options = [wood_options, size_options, leaves_options, edge_options, height_options, thickness_options, finish_options]
  15.  
  16. # Generate all possible combinations of the options
  17. combinations = []
  18. for wood in options[0]:
  19. for size in options[1]:
  20. for leaves in options[2]:
  21. for edge in options[3]:
  22. for height in options[4]:
  23. for thickness in options[5]:
  24. for finish in options[6]:
  25. combination = [wood, size, leaves, edge, height, thickness, finish]
  26. combinations.append(combination)
  27.  
  28. # Specify the file path on Android
  29. file_path = "/storage/emulated/0/Documents/possible_combinations.csv"
  30.  
  31. # Write the combinations to a CSV file
  32. with open(file_path, 'w', newline='') as csvfile:
  33. writer = csv.writer(csvfile)
  34. writer.writerow(['Wood', 'Size', 'Leaves', 'Table Edge', 'Height', 'Table Thickness', 'Finish']) # Write header row
  35. for combination in combinations:
  36. writer.writerow(combination)
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement