Use pandas.ExcelWriter with worksheet.data_validation from xlswriter :
df["code"] = None
items = list(range(1,10))
max_row, max_col = df.shape
with pd.ExcelWriter("/tmp/file.xlsx") as writer:
df.to_excel(writer, index=False, sheet_name="Sheet1", startrow=0)
wb = writer.book
ws = writer.sheets["Sheet1"]
ws.data_validation(f"C2:C{str(max_row+2)}", {"validate": "list", "source": items})
Output :