Monday, April 21, 2025

Reading a File with For Loop - Python

file = open('some-file.txt', 'r')

backup = open('backup.txt', 'w')

for x in file:
    backup.write(x)

file.close()
backup.close()

No comments:

Post a Comment

Tkinter Introduction - Top Widget, Method, Button

First, let's make shure that our tkinter module is working ok with simple  for loop that will spawn 5 instances of blank Tk window .  ...