Hi everyone im making a program to keep track of your movies just keeping it simple !
but im having a problem i am writing what movies you have to a text file but i cant append to it every time i write to the text file it overwrites everything here is what i have to far im using easygui to make a multenterbox to get 3 enter boxes
import easygui import sys import os from easygui import * textfile = file('movies.txt','wt') msgbox(msg='This program is to keep track of all the movies you own',title='Movie Catalog',ok_button='OK',image=None,root=None) wouldyou = choicebox(msg='Would you like to enter a movie or view the movies you already own?',title='',choices=('Enter a movie', 'View my movies')) if wouldyou == "Enter a movie": msg='Please enter the name of the movie' title='Movie Catalog' fieldNames=("Name of movie", "Genre", "Movie description") fieldValues =  fieldValues = multenterbox(msg, title, fieldNames) if fieldValues == None: sys.exit(0); myString = "".join(fieldValues) doc = open('movies.txt', 'a') doc.write(myString + "\n") raw_input("press any key to exit")
oh and i was wondering how i would go about taking the input out of the text file and identifie it as Movietitle, Genre, Description
Edited 5 Years Ago by huntaz556: n/a