here is the code: def changer(): """Changer from Serbian to Croatian for this letters: æ, è, ð in ć, č, đ """ whatfile = raw_input('Enter location of your file: ')
# open and read file ofile = open(whatfile, 'r') S = ofile.read() ofile.close() # search file and replace æ, è in ć, č for i in S: S = S.replace('æ', 'ć') S = S.replace('è', 'č') S = S.replace('ð', 'đ') # open and write to file infile = open(whatfile, 'w') infile.write(S) infile.close() I attached file too.
literalschanger.rar
Description: Binary data
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor