Új hozzászólás Aktív témák
-
Hege1234
addikt
sziasztok!
a cél az lenne, hogy ha már létezik ott egy ugyan olyan mappa az abban lévő fájlt csak simán írja felűl, de a shutil már az ugyan olyan mappára kiakad..
a fájlig el se tudtam még jutnihogyan lehetne megoldani?
def move_or_copy(src, dest):
if os.path.isdir(src):
if not os.path.exists(dest):
shutil.copytree(src, dest)
print(f"A mappa áthelyezve: {os.path.abspath(dest)}")
else:
for src_item in os.listdir(src):
src_file = os.path.join(src, src_item)
dest_file = os.path.join(dest, src_item)
move_or_copy(src_file, dest_file)
elif os.path.isfile(src):
if os.path.exists(dest):
print(f"A fájl '{os.path.abspath(dest)}' már létezik, felülírás...")
shutil.move(src, dest)
print(f"A fájl áthelyezve: {os.path.abspath(dest)}")
src_path = ripper_dir + '\\Downloads\\'
trg_path = dirPath + '.\\Downloads\\befejezett\\Prime\\!VT HD!\\Series'
for src_item in os.listdir(src_path):
src = os.path.join(src_path, src_item)
dest = os.path.join(trg_path, src_item)
move_or_copy(src, dest)error:
Traceback (most recent call last):
File "C:\Users\@\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1885, in __call__
return self.func(*args)
File "I:\python v3\main.py", line 59820, in vt_amzn_Series_hd_01
shutil.move(src_file, dest)
File "C:\Users\@\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 801, in move
raise Error("Destination path '%s' already exists" % real_dst)
shutil.Error: Destination path 'I:\python v3\Downloads\befejezett\Prime\!VT HD!\Series\Odaat.S07.1080p.AMZN.WEB-DL.DDP2.0.H.264-\Odaat.S07.1080p.AMZN.WEB-DL.DDP2.0.H.264-' already exists
Új hozzászólás Aktív témák
- AKCIÓ 03.30-ig!!! Intel Core ULTRA 9 285K +2x16GB 7600MHz Patriot Viper XTREME 5! (Bolti ár: 600e!)
- AKCIÓ 03.30-ig!!! Intel Core ULTRA 9 285K +2x16GB 7600MHz Patriot Viper XTREME 5! (Bolti ár: 600e!)
- 0 perces COOLER MASTER 650W MWE V2 minőségi tápegység! GAR/SZÁMLA (Te nevedre)! 12V: 54A!
- AKCIÓ 03.30-ig!!! Intel Core ULTRA 5 225F +32GB DDR5 kit +hűtött VRM-es alaplap! GAR/SZÁMLA!
- AKCIÓ 03.30-ig!!! Intel Core ULTRA 5 225F +32GB DDR5 kit +hűtött VRM-es B860 lap! GAR/SZÁMLA!
- Apple iPhone 14 Pro Max - Silver - 128GB - ÚJ - Biztosító által cserélt
- Üzleti kategóriás laptopok, asztali számítógépek, alkatrészek,garanciával, ZoliLaptop.hu
- HP Victus Gaming Laptop RTX 4070 / i7-13700H 16GB DDR5 1TB SSD Garancia
- Acer Predator Gamer PC! i7-14700F / RTX 4070 Super / 32GB DDR5 / 1TB NVMe!
- Részletfizetés Kamatmentes 12 havi részlet Acer Predator 18 AI Gamer / Laptop RTX 5070 Ti Ultra 9
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
