Hope this helps. It's not exactly what u were doing, but I built a tiny program to take in lyrics. I imagine it's clunky and not necessarily efficient (u generally should not go more than 3 nests deep...this goes 4 deep early on actually) but it does the job. It runs on python3 (I imagine this is what u are also using.) Run it initially using the input option to input your lyrics, then run it again using the load option to read them.
this is the class file...save it as lyrics1cl.py
The program will build a .txt file for your lyrics and the text file should pop up in the same folder...that way you won't have to run the program for the print out - if you don't want to - Python is considered the easiest to learn but at our stage Python can pi** us off occasionally and sometimes not interacting with it is lovely - hence the text file...if you are frustrated just open than up..
this is the class file...save it as lyrics1cl.py
#lyrics1cl.py class L(): def __init__(self): self._lyric_list =[] def adding(self,item): self._item = item self._lyric_list.append(self._item) def create_file(self,f): self.f = f + '.txt' with open(self.f, 'a+') as tf: for thing in self._lyric_list: tf.write(thing+'\n') tf.close def print_file(self,f): self.f = f+'.txt' with open(self.f) as tf: tf.seek(0) print(tf.read()) tf.closeBelow is the 'main' file that you will run ...save this as whatever you want... I suggest placing both in 1 folder.
The program will build a .txt file for your lyrics and the text file should pop up in the same folder...that way you won't have to run the program for the print out - if you don't want to - Python is considered the easiest to learn but at our stage Python can pi** us off occasionally and sometimes not interacting with it is lovely - hence the text file...if you are frustrated just open than up..
#lyrics1.py from lyrics1cl import L Song= L() print('1] - input\n2] - load') choice=input('choose one the above options.') selection = True while selection: if choice =='1' or choice =='input': enter_lyric=str(input('enter line below [enter- to stop].')) if enter_lyric == '': selection = False savefile=str(input('hit [enter] to save your lyrics.')) if savefile== '': new_file=str(input('enter filename (w/out ext).')) Song.create_file(new_file) view = str(input('hit [enter] to view lyrics.')) if view == '': Song.print_file(new_file) Song.adding(enter_lyric.strip()) elif choice =='2' or choice =='load': enter_file=str(input('enter file name (w/out ext).')) Song.print_file(enter_file) break else: break print('thx. Good bye.')I'm very much a noob like you. I'm not a particularly big fan of interactive. IMHO it's a great tool to quickly write/run/debug, but only when you are experienced enough with python syntax and only when you are comfortable enough to navigate things like traceback errors without the initial freakout (my heart certainly skips a beat with tracebacks). At our level, I don't think interactive is very helpful. My preference is very much ide.