我想通過數據庫循環,找到合適的值並將它們插入到單獨文件中的相應單元格中。它可能是一個csv或其他人可讀的格式。 在僞代碼:寫表格單元格實時python
for item in huge_db:
for list_of_objects_to_match:
if itemmatch():
if there_arent_three_matches_yet_in_list():
matches++
result=performoperationonitem()
write_in_file(result, row=object_to_match_id, col=matches)
if matches is 3:
remove_this_object_from_object_to_match_list()
你能想到的不是通過行會,每次通過所有OUTPUTFILE線以外的任何方式? 我甚至不知道要搜索什麼... 甚至更好,有更好的方法來在數據庫中找到三個匹配的對象,並實時得到結果? (操作起來需要一段時間,但我想看到的結果凸顯RT)
我可以考慮創建一組文件夾/文件而不是表格,但似乎是一個矯枉過正的... – deddu 2013-04-06 01:20:03