Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import os
  2.  
  3. filepath = 'C:/Any/file/Path'
  4.  
  5. filename = input("Enter your file name : ")
  6.  
  7. fileextention = input("Enter your extension : ")
  8.  
  9. fn = filename + "." + fileextention
  10.  
  11. path_file = os.path.join(filepath, filename)
  12.  
  13. print("Your file will be in path ", filepath)
  14.  
  15. print("nYour file will look like " + fn)
  16.  
  17. r1 = int(input("Starting for range : "))
  18.  
  19. r2 = int(input("Range till : "))
  20.  
  21. for i in range(r1, r2):
  22. filehandle = open(path_file + str(i) + "." + fileextention, "a")
  23. filehandle.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement