On 20/04/2015 04:49, Jim Mooney wrote:
For randomly generating data which look like addresses, I use:

http://www.generatedata.com/

While it has 'export to programming language' as a feature, Python isn't
one of the supported languages.  Which is fine.  It can export into comma
separated values, and writing a Python program to construct a dictionary
from comma separated values is easy.

Laura


That's a great source, and I can generate dictionaries using the other
advice. If you don't request comma delimited, each record per line has   |
as a field delimiter, so making big dicts was easy. Naturally, I tried
emailing one of the addresses - aliq...@nunc.org - but it appears to be
dead ;')

Come to think of it, since I used  |  as a delimiter, what happens if you
generate a CSV file from data that already has commas in the text?


For those who don't know you can use any character as the delimiter and any character as the quote, see https://docs.python.org/3/library/csv.html#csv.reader

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to