Create a Python 3 file

Asked

Viewed 32 times

0

I want to build a Python 3 function, which takes as a parameter a name of a text file and creates a new file. txt, named double.txt, which is the copy of the first one. How do I do this?

1 answer

0

import shutil

shutil.copy2(src, dst)

src and dst are paths, where src is the current and dst is the file copy path

Doc: shutil

Related answer: stackoverflow

Browser other questions tagged

You are not signed in. Login or sign up in order to post.