saurabh belote Posted on Sep 22, 2021 python program to copy file #python from shutil import copyfile copyfile("/root/a.txt", "/root/b.txt") Enter fullscreen mode Exit fullscreen mode Top comments (3) Subscribe Submit Preview Dismiss Collapse Expand RocketMaker69 RocketMaker69 RocketMaker69 Follow Joined Sep 25, 2021 • Sep 25 '21 Dropdown menu Copy link Hide or: fa = open("root/a.txt", "r").read() fb = open("root/b.txt", "w") fb.write(fa) Collapse Expand saurabh belote saurabh belote saurabh belote Follow I will share my daily learning here I think this will help anyone who want to explore more in programming. Email saurabhbelote112@gmail.com Education Master's In computer Science Work AIking Solution Pvt Ltd Joined Aug 14, 2021 • Sep 25 '21 Dropdown menu Copy link Hide Thanks for sharing Collapse Expand RocketMaker69 RocketMaker69 RocketMaker69 Follow Joined Sep 25, 2021 • Sep 25 '21 Dropdown menu Copy link Hide you're welcome! Code of Conduct • Report abuse
Top comments (3)
or:
fa = open("root/a.txt", "r").read()
fb = open("root/b.txt", "w")
fb.write(fa)
Thanks for sharing
you're welcome!