import datetime import pyperclip def instructions(): helpText =''' 1. == To home wormhole 2. == Wormhole away from home 3. == Combat Site Data or Relic site. 4. == Anons of interest L == Low Sec H == High Sec N == Null Sec J == Jspace (wormholes) ''' today = datetime.date.today() helpText += "\t" helpText += (today.strftime('%d-%b-%y')) helpText += "\n" return helpText contents = [] line = ' ' splitContents = [] #grab input while True: try: line = input() if line == '': break else: contents.append(line) except EOFError: break #Split the lines by tab for line in contents: splitContents.append(line.split('\t')) #put system name to frot of list for line in range(len(splitContents)): try: splitContents[line].insert(0, splitContents[line].pop(3)) except: break #Alphabetize splitContents.sort() #print out prettyPrint = "" print ("```") prettyPrint += "```\n" print(instructions()) prettyPrint += instructions() last = "nullnope" for line in range(len(splitContents)): try: if last != splitContents[line][0]: print(splitContents[line][0]) prettyPrint += str(splitContents[line][0]) prettyPrint += "\n" last = splitContents[line][0] print("\t", splitContents[line][1]) prettyPrint += "\t" prettyPrint += str(splitContents[line][1]) prettyPrint += "\n" except: break print ("```") prettyPrint += ("```") pyperclip.copy(prettyPrint) print("printing pretty print", prettyPrint)