Can Python fix vcard files?

Dotan Cohen dotancohen at gmail.com
Tue Oct 14 04:00:47 CEST 2008


2008/10/14  <skip at pobox.com>:
> Off the top of my head I don't know (and it may well vary by Python
> version).  Just leave out the dangerous parts of the loop to check:
>
>    for f in glob.glob('*.vcf'):
>        # corrupt data
>        uncooked = open(f, 'rb').read()
>        # fix it
>        cooked = uncooked.replace('\n ', '')
>        # and write it to the bit bucket
>        open(os.path.devnull, 'wb').write(cooked)
>
> Skip
>

Thanks, Skip. I don't quite follow but I've got enough to google on
now. In any case I see that there are unicode-specific parts to TFM so
I'm rather faithful that any gotchas will be spelled out there.

Thanks!

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

ä-ö-ü-ß-Ä-Ö-Ü


More information about the Python-list mailing list