[Chandler-dev] Getting started with a python script for Chandler
Andre Mueninghoff
andre_mueninghoff at fastmail.fm
Fri Dec 21 21:53:01 PST 2007
On Fri, 30 Nov 2007 11:12:17 -0800, "Jeffrey Harris"
<jeffrey at osafoundation.org> said:
You might consider:
>
> import codecs
> file = codecs.open(filename, "a", "utf-8")
>
> so you don't have to convert your unicode string-by-string.
>
Hi Jeffrey,
Okay, I'm stumped...Q. How does one force returns (carriage return+line
feed) when using this shortcut for codecs?
This doesn't seem to work for me:
file.write('-------------------------------------------\n')
file.write('%s\n' % item_title)
line2 = string_triageStatus.upper() + " " + string_date + "
" + item_dateSource + "\n"
file.write('%s\n' % line2)
file.write('%s\n\n' % item_body)
I get a "smoosh" (technical term) in my text file with no returns/line
feeds.
Thanks much, Andre
More information about the chandler-dev
mailing list