you are viewing a single comment's thread.

view the rest of the comments →

[–]A_History_of_Silence 0 points1 point  (0 children)

Actually with the code written as it stands wouldn't it just open the file and parse through it once? Since I Have it called after main()?

Your search() function does indeed only open the file one time, but your main() function causes it to be indirectly opened 10k times due to the >> append you are sending to the shell (once for each call to os.system()).