Only a reminder...
import pandas as pd
from io import StringIO
titleData = StringIO("""col1;col2;col3""")
dk = pd.read_csv(titleData,sep=";")
for i in all_instruments('CS').order_book_id:
k = instruments(i)
testData = StringIO(
"""col1;col2;col3
%s;%s;%s""" % (k.order_book_id,k.industry_name,k.industry_code)
)
df = pd.read_csv(testData,sep=";")
dk = dk.append(df)
dk.to_csv('guomin.csv')