Hi i write script prasing text from web and my otput file must be in Non-ISO extended-ASCII text, with CRLF, LF line terminators How i can write file as this codepage ?.
def save_file(potoczek, nazwapliku):
file = open(nazwapliku,"w")
file.write(potoczek)
file.close()
return()
#...
t1='"'+tab[0]+'\"\n'+naglowek+wykli(zawartosc0).encode('latin2')
t2='"'+tab[1]+'\"\n'+naglowek+wykli(zawartosc1).encode('latin2')
t3='"'+tab[2]+'\"\n'+naglowek+wykli(zawartosc2).encode('latin2')
t4='"'+tab[3]+'\"\n'+naglowek+wykli(zawartosc3).encode('latin2')
TRAKTOR = t1+t2+t3+t4
print udata
save_file(TRAKTOR,PLIK_SCIEZKA)
file ~/stare_ceny/jacek/stare_ceny/2012-07-02.csv /home/jacek/stare_ceny/2012-07-02.csv: Non-ISO extended-ASCII text, with CRLF, LF line terminators
latin 2 is alias for ISO-8859-2 New file ` jacek@R2D2:~/skrypty$ file /var/usterki/ceny_2012-09-04_08-11-46.csv /var/usterki/ceny_2012-09-04_08-11-46.csv: UTF-8 Unicode text `