Python Forum

Full Version: Copy paste on a file automatically
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys, hope you are having a nice week-end.
I have a personal problem, I am not really good at Python, I know few things but enough for these kinds of problems
I actually want to create a program that will copy paste what have just been placed in a file, in another file so that nothing will be lost if the first file I was talking about is deleted.
Solving this problem would help me so much, way better if I understand what you've done !
Copying the file spam.txt to spam.txt.bak is very easy to do for a python program. Your question implies that the program should cleverly decide when the copy must be done. This part is unclear in your question. Note that every time the program copies the file, the old version of spam.txt.bak is erased, so tell us how the program should know when to make the copy?
(Jan-18-2020, 04:29 PM)Aure4 Wrote: [ -> ]way better if I understand what you've done !

Lucky for you, no one is likely to write it for you. lol If you try first and post your attempt here, even if it is terrible, people will be more eager to help.

Find yourself some tutorials. I'm a fan of youtube, but if you search "python read write file" anywhere you'll find tons.

Show me what you come up with.

M.