What I'd like to do is basically I have this file with data in separate lines, except the last piece which is a biography and may stretch across many lines. The biography may be any number of lines long, and all I know is that it starts on the 5th line. Now what I need is a way to retrieve the biography from the fifth line to the end of the file, but I don't know how to do this. Thanks in advance.
Here's what I tried:
from tkinter import *
import os
class App:
charprefix = "character_"
charsuffix = ".iacharacter"
chardir = "data/characters/"
def __init__(self, master):
self.master = master
frame = Frame(master)
frame.pack()
# character box
Label(frame, text = "Characters Editor").grid(row = 0, column = 0, rowspan = 1, columnspan = 2)
self.charbox = Listbox(frame)
for chars in []:
self.charbox.insert(END, chars)
self.charbox.grid(row = 1, column = 0, rowspan = 5)
charadd = Button(frame, text = " Add ", command = self.addchar).grid(row = 1, column = 1)
charremove = Button(frame, text = "Remove", command = self.removechar).grid(row = 2, column = 1)
charedit = Button(frame, text = " Edit ", command = self.editchar).grid(row = 3, column = 1)
for index in self.charbox.curselection():
charfilelocale = self.charbox.get(int(index))
charfile = open(app.chardir + app.charprefix + app.charfilelocale, 'r+')
charinfo = str.splitlines(0)