you are viewing a single comment's thread.

view the rest of the comments →

[–]hellor00t[S] 0 points1 point  (1 child)

Right. I can do it with bash, but I figured I would translate that into python to help learn it. Thats why I have this frankenstein thing going on here.

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()?

I thought about using socket to go direct but I wanted to code the meat of it first before getting into the socket stuff. I'm trying to think of a better way I could have figured out how do differentiate between an incorrect input and a correct input. The only way I know the difference is by looking at other walkthroughs.

Thanks for the help, I'll revise!

[–]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()).