df1 = pd.read_csv('read.csv')
run = 0

def crawl(a):
    global run
run = run + 1
df2 = pd.DataFrame([[x, y]], columns=['X', 'Y'])
if run == 1:
    df2.to_csv('output.csv')
if run != 1:
    df2.to_csv('output.csv', header=None, mode='a')
df1['Column A'].apply(crawl)
Pandas: Continuously write from function to csv