Monday, March 5, 2018

Python copy content of file to another file

Python:

Copy the content of inputfile.txt to outputfile.txt:

with open("outputfile.txt","w") as fw,open("inputfile.txt") as f:
    for line in f:
        fw.write(line)

No comments:

Post a Comment

Spring Boot 3 : JWT with SecurityFilterChain, AuthorizeHttpRequests, RequestMatchers

pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0"...