I want to insert my Random()'s return value into txt file without overwrite ('a') and to a specific location, like at the sixt character, but when I execute this, Random is insert to the third line.
`def Modif_Files(p_folder_path):
Tab = []
for v_root, v_dir, v_files in os.walk(p_folder_path):
print v_files
for v_file in v_files:
file = os.path.join(p_folder_path, v_file)
#with open(file, 'r') as files:
#for lines in files.readlines():
#Tab.append([lines])
with open(file, 'a') as file:
file.write("\n add " + str(Random())) #Random = int
#file.close
def Random():
global last
last = last + 3 + last * last * last * last % 256
return last
def main ():
Modif_Files(Modif_Path, 5) # Put path with a txt file inside
if __name__ == '__main__':
main()
`