Skip to content

Instantly share code, notes, and snippets.

@RoyalScribblz
RoyalScribblz / shopstoworth.py
Created April 22, 2020 12:47
Convert GuiShop shops.yml to Essentials worth.yml
import re
import csv
items = []
success = 0
with open("items.csv", "r") as itemscsv:
for line in itemscsv:
items.append(re.sub("\n", "", line))
worthyml = "worth:\n"
#Content is from a csv file which is in the format ID,buy-price,sell-price for items and just the name for a category
import csv
counter = 0
completed = ""
categories = 0
items = 0
filename = input("Enter .csv filename: ") + ".csv"
with open(filename) as csvfile:
creader = csv.reader(csvfile)