Apr-04-2017, 10:59 PM
Complete Noob to programming. With that out of the way, Going into the function does not appear to be happening.
I put a print statement in the "if then" to verify my condition was in fact matching (it is, 35 times).
I commented out that print statement; I then commented out all the function, and added a very simple print statement.
I get zero output within the function.
Would love to know what I'm missing.
Many Thanks,
PappaBear
I put a print statement in the "if then" to verify my condition was in fact matching (it is, 35 times).
I commented out that print statement; I then commented out all the function, and added a very simple print statement.
I get zero output within the function.
Would love to know what I'm missing.
Many Thanks,
PappaBear
original_file = open('c:\\scripts\\original-objects.txt', 'r') new_file = open('c:\\scripts\\converted-objects.txt', 'w') print("Prepped both input/output files") addressword = "object " def found_new_address_object(): print ("Now in Function") # commented out conversion steps # writing out to a new file, etc return original_lines = original_file.readlines() print ("Starting for loop") for counter in range(len(original_lines)): if addressword in original_lines[counter]: #print ("yes on if statement") found_new_address_object