C
C
cryptoforum2021-06-16 09:21:13
Python
cryptoforum, 2021-06-16 09:21:13

How to replace a folder if it already exists?

Tried through try, everything is useless, I can not overwrite.

os.mkdir(rf"C:\\Users\\{user}\\AppData\\files")

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
pfemidi, 2021-06-16
@cryptoforum

os.rename to rename ("replace" if I understood correctly)

V
Vladimir Korotenko, 2021-06-16
@firedragon

Check if there is a problem

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question