Guest User

Untitled

a guest
May 14th, 2015
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. import os
  2.  
  3. def main():
  4. login = 'admin'
  5. passw = '12345'
  6. ip_count = 200
  7. path_to_inp_file = 'c:\\test\\results.txt'
  8. path_to_out_file = 'c:\\test\\ip_out_'
  9. file = open(path_to_inp_file,'r')
  10.  
  11. k = 0
  12. j = 1
  13.  
  14. for line in file:
  15. csv = open(path_to_out_file+str(j)+'.csv','a')
  16. temp = '"' + str(k) + '_ip","0","'+line[0:-1:1]+'","8000","0","'+login+'","'+passw+'","0","1","0","0"'+'\n'
  17. csv.write(temp)
  18. k += 1
  19. if k % ip_count == 0:
  20. j += 1
  21. csv.close()
  22.  
  23. file.close()
  24. print('Done')
  25. print('Press any key to continue...')
  26. input()
  27.  
  28. def menu():
  29. os.system('cls')
  30. print('What change?',end='\n')
  31. print('[1] Login',end='\n')
  32. print('[2] Password',end='\n')
  33. print('[3] Input file',end='\n')
  34. print('[4] Output file',end='\n')
  35. print('[5] Number of IP in file')
  36. print('[0] Perform',end='\n')
  37. return int(input())
  38.  
  39. if __name__ == '__main__':
  40. main()
Advertisement
Add Comment
Please, Sign In to add comment