I have a script which exports some results to a dbf file (dbf is my only export option for the software I am using). I would like to use these results (number of rows will vary) to output a sentence containing the results to a file.
For example
Cars.dbf
Toyota
Mazda
Kia
Volkswagon
I want to output the following sentence:
Within this neighborhood there is a Toyota, Mazda, Kia, and Volkswagon parked on the street.
If the results are two I do not want commas:
Cars.dbf
Toyota
Mazda
Within this neighborhood there is a Toyota and Mazda parked on the street.
Cars.dbf
empty
There are no cars parked on the street within this neighborhood.
I know how to do if else statements, but am unsure how to pass the dbf records as variables in a sentence. Ideas anyone?
Using python 2.7.
A thousand thanks in advance.