Python move a file 🗃️

Pubblicato il: 21 dicembre 2020
sul canale di: Bro Code
28,216
1k

Python move replace file tutorial example explained

#python #move #replace #file

import os

source = "C:\\Users\\User\\Desktop\\source.txt"
destination = "C:\\Users\\User\\Desktop\\destination.txt"

try:
if os.path.exists(destination):
print("There is already a file there")
else:
os.replace(source,destination)
print(source+" was moved")
except FileNotFoundError:
print(source+" was not found")

Bro Code merch store: https://teespring.com/stores/bro-code-5


In questa pagina del sito puoi guardare il video online Python move a file 🗃️ della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Bro Code 21 dicembre 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 28,216 volte e gli è piaciuto 1 mille spettatori. Buona visione!