fr0stn1k

Untitled

Nov 30th, 2020
430
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Чтение файла
  2. with open('vk_ids.txt') as file_object:
  3.     contents = file_object.read()
  4.     print(contents)
  5.  
  6. # Построчное чтение файла
  7. with open('vk_ids.txt') as file_object:
  8.         for line in file_object:
  9.                 print(line)
  10. # Запись в файл
  11. filename = 'test.txt'
  12.  
  13. with open(filename, 'w') as file_object:
  14.     for item in range(30,41):
  15.         file_object.write(str(item)+ "\n")
  16.  
  17.  
RAW Paste Data