Файл перемещения Python: полное руководство

–ú–µ—Ç–æ–¥ Python shutil.move () –ø–µ—Ä–µ–º–µ—â–∞–µ—Ç —Ñ–∞–π–ª –≤ –¥—Ä—É–≥–æ–µ –º–µ—Å—Ç–æ –Ω–∞ –≤–∞—à–µ–º –∫–æ–º–ø—å—é—Ç–µ—Ä–µ. –≠—Ç–æ—Ç –º–µ—Ç–æ–¥ —è–≤–ª—è–µ—Ç—Å—è —á–∞—Å—Ç—å—é –º–æ–¥–µ–ª–∏ shutil, –∫–æ—Ç–æ—Ä—É—é –Ω–µ–æ–±—Ö–æ–¥–∏–º–æ –∏–º–ø–æ—Ä—Ç–∏—Ä–æ–≤–∞—Ç—å –ø–µ—Ä–µ–¥ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏–µ–º —ç—Ç–æ–≥–æ –º–µ—Ç–æ–¥–∞.

–ü–µ—Ä–µ–º–µ—â–µ–Ω–∏–µ —Ñ–∞–π–ª–æ–≤ - –æ–±—ã—á–Ω–∞—è –æ–ø–µ—Ä–∞—Ü–∏—è –≤ –ø—Ä–æ–≥—Ä–∞–º–º–∞—Ö Python. –ù–∞–ø—Ä–∏–º–µ—Ä, —Å–∫–∞–∂–µ–º, –≤—ã —Å–æ–∑–¥–∞–µ—Ç–µ –ø—Ä–æ–≥—Ä–∞–º–º—É, –∫–æ—Ç–æ—Ä–∞—è –≥–µ–Ω–µ—Ä–∏—Ä—É–µ—Ç —Ñ–∞–π–ª—ã. –í—ã –º–æ–∂–µ—Ç–µ –ø–µ—Ä–µ–º–µ—Å—Ç–∏—Ç—å –≤—Å–µ —Å—É—â–µ—Å—Ç–≤—É—é—â–∏–µ —Ñ–∞–π–ª—ã –∏–∑ –ø–∞–ø–∫–∏ –≤ –¥—Ä—É–≥–æ–µ –º–µ—Å—Ç–æ, —á—Ç–æ–±—ã –æ—Å–≤–æ–±–æ–¥–∏—Ç—å –º–µ—Å—Ç–æ –¥–ª—è –Ω–æ–≤—ã—Ö —Ñ–∞–π–ª–æ–≤, –∫–æ—Ç–æ—Ä—ã–µ –≤—ã —Ö–æ—Ç–∏—Ç–µ —Å–æ–∑–¥–∞—Ç—å.

–í–æ—Ç –≥–¥–µ shutil.move () –≤—Ö–æ–¥–∏—Ç —Ñ—É–Ω–∫—Ü–∏—è. –§—É–Ω–∫—Ü–∏—è shutil.move () –ø–æ–∑–≤–æ–ª—è–µ—Ç –ø–µ—Ä–µ–º–µ—â–∞—Ç—å —Ñ–∞–π–ª –∏–∑ –æ–¥–Ω–æ–π –ø–∞–ø–∫–∏ –≤ –¥—Ä—É–≥—É—é –≤ –≤–∞—à–µ–π —Å–∏—Å—Ç–µ–º–µ. –í —ç—Ç–æ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ —Å–æ —Å—Å—ã–ª–∫–æ–π –Ω–∞ –ø—Ä–∏–º–µ—Ä—ã –±—É–¥–µ—Ç –æ–±—Å—É–∂–¥–∞—Ç—å—Å—è, –∫–∞–∫ –º–æ–∂–Ω–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Ñ—É–Ω–∫—Ü–∏—é shutil.move () –¥–ª—è –ø–µ—Ä–µ–º–µ—â–µ–Ω–∏—è –∫–æ–¥–∞.

Python shutil

–ú–æ–¥—É–ª—å shutil –ø—Ä–µ–¥–æ—Å—Ç–∞–≤–ª—è–µ—Ç —à–∏—Ä–æ–∫–∏–π —Å–ø–µ–∫—Ç—Ä –≤—ã—Å–æ–∫–æ—É—Ä–æ–≤–Ω–µ–≤—ã—Ö –æ–ø–µ—Ä–∞—Ü–∏–π, –∫–æ—Ç–æ—Ä—ã–µ –≤—ã –º–æ–∂–µ—Ç–µ –≤—ã–ø–æ–ª–Ω—è—Ç—å —Å —Ñ–∞–π–ª–∞–º–∏. –í –æ—Ç–ª–∏—á–∏–µ –æ—Ç –±–∏–±–ª–∏–æ—Ç–µ–∫–∏ os, shutil –∏–º–µ–µ—Ç —Ñ—É–Ω–∫—Ü–∏–∏, –∫–æ—Ç–æ—Ä—ã–µ –º–æ–≥—É—Ç –≤—ã–ø–æ–ª–Ω—è—Ç—å—Å—è –¥–ª—è –∫–æ–ª–ª–µ–∫—Ü–∏–π —Ñ–∞–π–ª–æ–≤.

–í —ç—Ç–æ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ –º—ã —Å–æ—Å—Ä–µ–¥–æ—Ç–æ—á–∏–º—Å—è –Ω–∞ —Ñ—É–Ω–∫—Ü–∏–∏ shutil.move () , –∫–æ—Ç–æ—Ä—ã–π –ø–æ–∑–≤–æ–ª—è–µ—Ç –Ω–∞–º –ø–µ—Ä–µ–º–µ—â–∞—Ç—å —Ñ–∞–π–ª —Å –ø–æ–º–æ—â—å—é Python.

–ü—Ä–µ–∂–¥–µ —á–µ–º –º—ã –∏—Å—Å–ª–µ–¥—É–µ–º —Ñ—É–Ω–∫—Ü–∏—é move (), –º—ã –¥–æ–ª–∂–Ω—ã —Å–Ω–∞—á–∞–ª–∞ –∏–º–ø–æ—Ä—Ç–∏—Ä–æ–≤–∞—Ç—å –±–∏–±–ª–∏–æ—Ç–µ–∫—É shutil –≤ –Ω–∞—à –∫–æ–¥. –≠—Ç–æ –º–æ–∂–Ω–æ —Å–¥–µ–ª–∞—Ç—å —Å –ø–æ–º–æ—â—å—é —ç—Ç–æ–≥–æ –æ–ø–µ—Ä–∞—Ç–æ—Ä–∞ –∏–º–ø–æ—Ä—Ç–∞ Python :

Python Move File

–§—É–Ω–∫—Ü–∏—è shutil.move () –ø–µ—Ä–µ–º–µ—â–∞–µ—Ç —Ñ–∞–π–ª –Ω–∞ –≤–∞—à–µ–º –∫–æ–º–ø—å—é—Ç–µ—Ä–µ. –≠—Ç–æ—Ç –º–µ—Ç–æ–¥ –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –≤ –∫–∞—á–µ—Å—Ç–≤–µ –∞—Ä–≥—É–º–µ–Ω—Ç–æ–≤ –ø—É—Ç—å –∫ —Ñ–∞–π–ª—É, –∫–æ—Ç–æ—Ä—ã–π –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø–µ—Ä–µ–º–µ—Å—Ç–∏—Ç—å, –∏ –Ω–æ–≤—ã–π –ø—É—Ç—å –∫ —Ñ–∞–π–ª—É.

–°–∏–Ω—Ç–∞–∫—Å–∏—Å —ç—Ç–æ–π —Ñ—É–Ω–∫—Ü–∏–∏ —Å–ª–µ–¥—É—é—â–∏–π:

81% —É—á–∞—Å—Ç–Ω–∏–∫–æ–≤ –∑–∞—è–≤–∏–ª–∏, —á—Ç–æ –æ–Ω–∏ –ø–æ—Å–ª–µ –±—É—Ç–∫–µ–º–ø–∞ –ø–æ—á—É–≤—Å—Ç–≤–æ–≤–∞–ª–∏ —Å–µ–±—è –±–æ–ª–µ–µ —É–≤–µ—Ä–µ–Ω–Ω–æ –≤ —Å–≤–æ–∏—Ö –ø–µ—Ä—Å–ø–µ–∫—Ç–∏–≤–∞—Ö —Ç—Ä—É–¥–æ—É—Å—Ç—Ä–æ–π—Å—Ç–≤–∞ –≤ —Å—Ñ–µ—Ä–µ –≤—ã—Å–æ–∫–∏—Ö —Ç–µ—Ö–Ω–æ–ª–æ–≥–∏–π. –ü—Ä–æ–π–¥–∏—Ç–µ –∫—É—Ä—Å –æ–±—É—á–µ–Ω–∏—è —Å–µ–≥–æ–¥–Ω—è.

–í —Å—Ä–µ–¥–Ω–µ–º –≤—ã–ø—É—Å–∫–Ω–∏–∫ —É—á–µ–±–Ω–æ–≥–æ –ª–∞–≥–µ—Ä—è –ø–æ—Ç—Ä–∞—Ç–∏–ª –º–µ–Ω–µ–µ —à–µ—Å—Ç–∏ –º–µ—Å—è—Ü–µ–≤ –Ω–∞ –ø–µ—Ä–µ—Ö–æ–¥–Ω—É—é –∫–∞—Ä—å–µ—Ä—É, –æ—Ç –Ω–∞—á–∞–ª–∞ —É—á–µ–±–Ω–æ–≥–æ –ª–∞–≥–µ—Ä—è –¥–æ –ø–æ–∏—Å–∫–∞ —Å–≤–æ–µ–π –ø–µ—Ä–≤–æ–π —Ä–∞–±–æ—Ç—ã.

shutil.move () –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –¥–≤–∞ –ø–∞—Ä–∞–º–µ—Ç—Ä–∞, –∞ –∏–º–µ–Ω–Ω–æ:

  • –∏—Å—Ö–æ–¥–Ω—ã–π –ø—É—Ç—å : –ø—É—Ç—å –∫ —Ñ–∞–π–ª—É, –∫–æ—Ç–æ—Ä—ã–π –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø–µ—Ä–µ–º–µ—Å—Ç–∏—Ç—å.
  • —Ü–µ–ª–µ–≤–æ–π –ø—É—Ç—å : –ø—É—Ç—å –∫ —Ñ–∞–π–ª—É, –ø–æ –∫–æ—Ç–æ—Ä–æ–º—É –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø–µ—Ä–µ–º–µ—Å—Ç–∏—Ç—å —Ñ–∞–π–ª.

–§—É–Ω–∫—Ü–∏—è move () –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç –ø—É—Ç—å –∫ –ø–µ—Ä–µ–º–µ—â–µ–Ω–Ω–æ–º—É —Ñ–∞–π–ª—É.

–ï—Å–ª–∏ –≤–∞—à –ø—É–Ω–∫—Ç –Ω–∞–∑–Ω–∞—á–µ–Ω–∏—è —Å–æ–≤–ø–∞–¥–∞–µ—Ç —Å –¥—Ä—É–≥–∏–º —Ñ–∞–π–ª–æ–º, —Å—É—â–µ—Å—Ç–≤—É—é—â–∏–π —Ñ–∞–π–ª –±—É–¥–µ—Ç –ø–µ—Ä–µ–∑–∞–ø–∏—Å–∞–Ω.

–£–∫–∞–∑–∞–Ω–Ω—ã–µ –≤–∞–º–∏ –ø—É—Ç–∏ –∫ —Ñ–∞–π–ª–∞–º –º–æ–≥—É—Ç –±—ã—Ç—å –∞–±—Å–æ–ª—é—Ç–Ω—ã–º–∏ –∏–ª–∏ –æ—Ç–Ω–æ—Å–∏—Ç–µ–ª—å–Ω—ã–º–∏.

–ê–±—Å–æ–ª—é—Ç–Ω—ã–µ –ø—É—Ç–∏ –∫ —Ñ–∞–π–ª–∞–º - —ç—Ç–æ –ø–æ–ª–Ω—ã–µ –ø—É—Ç–∏, –≤–µ–¥—É—â–∏–µ –Ω–µ–ø–æ—Å—Ä–µ–¥—Å—Ç–≤–µ–Ω–Ω–æ –∫ —Ñ–∞–π–ª—É (—Ç. –µ. / home / –∫–∞—Ä—å–µ—Ä–∞_–∫–∞—Ä–º–∞ / —Ñ–∞–π–ª. txt). –û—Ç–Ω–æ—Å–∏—Ç–µ–ª—å–Ω—ã–π –ø—É—Ç—å –∫ —Ñ–∞–π–ª—É –æ—Ç–Ω–æ—Å–∏—Ç—Å—è –∫ —Ä–∞—Å–ø–æ–ª–æ–∂–µ–Ω–∏—é –æ—Ç–Ω–æ—Å–∏—Ç–µ–ª—å–Ω–æ –∫–∞—Ç–∞–ª–æ–≥–∞, –≤ –∫–æ—Ç–æ—Ä–æ–º –≤—ã–ø–æ–ª–Ω—è–µ—Ç—Å—è –≤–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ Python (–Ω–∞–ø—Ä–∏–º–µ—Ä, file.txt).

–ï—Å–ª–∏ –µ—Å–ª–∏ —É–∫–∞–∑–∞—Ç—å –Ω–µ—Å—É—â–µ—Å—Ç–≤—É—é—â–∏–π –∫–∞—Ç–∞–ª–æ–≥ –Ω–∞–∑–Ω–∞—á–µ–Ω–∏—è, –±—É–¥–µ—Ç —Å–æ–∑–¥–∞–Ω –Ω–æ–≤—ã–π –∫–∞—Ç–∞–ª–æ–≥.

–ë–∏–±–ª–∏–æ—Ç–µ–∫–∞ –û–° —Å–æ–¥–µ—Ä–∂–∏—Ç os.rename ( ) , –∫–æ—Ç–æ—Ä—ã–π —á–∞—Å—Ç–æ –∏—Å–ø–æ–ª—å–∑—É–µ—Ç—Å—è –¥–ª—è –ø–µ—Ä–µ–∏–º–µ–Ω–æ–≤–∞–Ω–∏—è —Ñ–∞–π–ª–æ–≤. –≠—Ç–æ—Ç –º–µ—Ç–æ–¥ —Ç–∞–∫–∂–µ –º–æ–∂–µ—Ç –ø–µ—Ä–µ–º–µ—â–∞—Ç—å —Ñ–∞–π–ª—ã. –ù–æ –º–µ—Ç–æ–¥ shutil –±—ã–ª —Ä–∞–∑—Ä–∞–±–æ—Ç–∞–Ω —Å–ø–µ—Ü–∏–∞–ª—å–Ω–æ –¥–ª—è –ø–µ—Ä–µ–º–µ—â–µ–Ω–∏—è —Ñ–∞–π–ª–æ–≤. –°–∏–Ω—Ç–∞–∫—Å–∏—Å shutil.move () —ç—Ç–æ –ª–µ–≥—á–µ –ø–æ–Ω—è—Ç—å, —á–µ–º os.rename (), –µ—Å–ª–∏ –≤—ã –ø–µ—Ä–µ–º–µ—â–∞–µ—Ç–µ —Ñ–∞–π–ª.

–î–∞–≤–∞–π—Ç–µ —Ä–∞—Å—Å–º–æ—Ç—Ä–∏–º –Ω–µ—Å–∫–æ–ª—å–∫–æ –ø—Ä–∏–º–µ—Ä–æ–≤ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏—è —Ñ—É–Ω–∫—Ü–∏–∏ shutil.move ().

–ü–µ—Ä–µ–º–µ—â–µ–Ω–∏–µ –æ–¥–Ω–æ–≥–æ —Ñ–∞–π–ª–∞

–ü—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, —É –Ω–∞—Å –µ—Å—Ç—å —Ñ–∞–π–ª —Å –∏–º–µ–Ω–µ–º raw_data.csv, –∫–æ—Ç–æ—Ä—ã–π –º—ã —Ö–æ—Ç–∏–º –ø–µ—Ä–µ–º–µ—Å—Ç–∏—Ç—å –≤ –∫–∞—Ç–∞–ª–æ–≥ —Å –∏–º–µ–Ω–µ–º data –≤ –Ω–∞—à–µ–º —Ç–µ–∫—É—â–µ–º —Ä–∞–±–æ—á–µ–º –∫–∞—Ç–∞–ª–æ–≥–µ. –ú—ã –º–æ–≥–ª–∏ –±—ã —Å–¥–µ–ª–∞—Ç—å —ç—Ç–æ —Å –ø–æ–º–æ—â—å—é —Å–ª–µ–¥—É—é—â–µ–≥–æ –∫–æ–¥–∞:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç:

–°–Ω–∞—á–∞–ª–∞ –º—ã –∏–º–ø–æ—Ä—Ç–∏—Ä–æ–≤–∞–ª–∏ –±–∏–±–ª–∏–æ—Ç–µ–∫—É shutil. –ó–∞—Ç–µ–º –º—ã –æ–±—ä—è–≤–∏–ª–∏ –¥–≤–µ –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ Python . –ü–µ—Ä–µ–º–µ–Ω–Ω–∞—è source —Ö—Ä–∞–Ω–∏—Ç –∏–º—è —Ñ–∞–π–ª–∞, –∫–æ—Ç–æ—Ä—ã–π –º—ã —Ö–æ—Ç–∏–º –ø–µ—Ä–µ–º–µ—Å—Ç–∏—Ç—å. –ù–∞—à–∞ –ø–µ—Ä–µ–º–µ–Ω–Ω–∞—è destination —Ö—Ä–∞–Ω–∏—Ç –∏–º—è –∫–∞—Ç–∞–ª–æ–≥–∞, –≤ –∫–æ—Ç–æ—Ä—ã–π –º—ã —Ö–æ—Ç–∏–º –ø–µ—Ä–µ–º–µ—Å—Ç–∏—Ç—å –Ω–∞—à —Ñ–∞–π–ª.

–í —ç—Ç–æ–º –ø—Ä–∏–º–µ—Ä–µ –º—ã —É–∫–∞–∑–∞–ª–∏ –æ—Ç–Ω–æ—Å–∏—Ç–µ–ª—å–Ω—ã–µ –ø—É—Ç–∏ –∫ —Ñ–∞–π–ª—É –¥–ª—è –Ω–∞—à–µ–≥–æ –∏—Å—Ç–æ—á–Ω–∏–∫–∞ –∏ –º–µ—Å—Ç–∞ –Ω–∞–∑–Ω–∞—á–µ–Ω–∏—è. –≠—Ç–æ –æ–∑–Ω–∞—á–∞–µ—Ç, —á—Ç–æ —Ñ–∞–π–ª raw_data.csv –∏ –∫–∞—Ç–∞–ª–æ–≥ data –æ—Ç–Ω–æ—Å—è—Ç—Å—è –∫ —Ç–µ–º, –∫–æ—Ç–æ—Ä—ã–µ –Ω–∞—Ö–æ–¥—è—Ç—Å—è –≤ —Ç–æ–º –∂–µ –∫–∞—Ç–∞–ª–æ–≥–µ, —á—Ç–æ –∏ –Ω–∞—à —Ñ–∞–π–ª Python. –ï—Å–ª–∏ –Ω–∞—à —Ñ–∞–π–ª Python —Ö—Ä–∞–Ω–∏—Ç—Å—è –≤ / home / –∫–∞—Ä—å–µ—Ä–∞_–∫–∞—Ä–º–∞ / –ø—Ä–æ–≥—Ä–∞–º–º–∞, —Ñ–∞–π–ª –∏ –∫–∞—Ç–∞–ª–æ–≥, –Ω–∞ –∫–æ—Ç–æ—Ä—ã–µ –º—ã —Å—Å—ã–ª–∞–µ–º—Å—è, –±—É–¥—É—Ç —Ö—Ä–∞–Ω–∏—Ç—å—Å—è –≤ —ç—Ç–æ–º –∫–∞—Ç–∞–ª–æ–≥–µ.

–ó–∞—Ç–µ–º –º—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º shutil.move () –¥–ª—è –ø–µ—Ä–µ–º–µ—â–µ–Ω–∏—è –Ω–∞—à–µ–≥–æ —Ñ–∞–π–ª–∞. –ú—ã –Ω–∞–∑–Ω–∞—á–∞–µ–º —Ä–µ–∑—É–ª—å—Ç–∞—Ç –æ–ø–µ—Ä–∞—Ü–∏–∏ & mdash; –ø—É—Ç—å –∫ –ø–µ—Ä–µ–º–µ—â–µ–Ω–Ω–æ–º—É —Ñ–∞–π–ª—É & mdash ; –∫ –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π new_path. –ó–∞—Ç–µ–º –º—ã —Ä–∞—Å–ø–µ—á–∞—Ç—ã–≤–∞–µ–º –∑–Ω–∞—á–µ–Ω–∏–µ new_path, –∫–æ—Ç–æ—Ä–æ–µ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç –ø—É—Ç—å –∫ –Ω–∞—à–µ–º—É –Ω–æ–≤–æ–º—É —Ñ–∞–π–ª—É.

–ú—ã —É—Å–ø–µ—à–Ω–æ –ø–µ—Ä–µ–º–µ—Å—Ç–∏–ª —Ñ–∞–π–ª –≤ Python.

–ü—Ä–∏–º–µ—á–∞–Ω–∏–µ. –¢–æ—Ç –∂–µ —Å–∏–Ω—Ç–∞–∫—Å–∏—Å, –∫–æ—Ç–æ—Ä—ã–π –º—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–ª–∏ –¥–ª—è –ø–µ—Ä–µ–º–µ—â–µ–Ω–∏—è —Ñ–∞–π–ª–∞, —Ç–∞–∫–∂–µ –º–æ–∂–Ω–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –¥–ª—è –ø–µ—Ä–µ–º–µ—â–µ–Ω–∏—è –ø–∞–ø–∫–∏.

–ü–µ—Ä–µ–º–µ—â–µ–Ω–∏–µ —Ñ–∞–π–ª–∞ –∏ –∏–∑–º–µ–Ω–∏—Ç—å –µ–≥–æ –∏–º—è

–§—É–Ω–∫—Ü–∏—è shutil.move () –ø–æ–∑–≤–æ–ª—è–µ—Ç –≤–∞–º –∏–∑–º–µ–Ω–∏—Ç—å –∏–º—è —Ñ–∞–π–ª–∞ –ø–æ—Å–ª–µ –µ–≥–æ –ø–µ—Ä–µ–º–µ—â–µ–Ω–∏—è.

–ü—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, –º—ã —Ö–æ—Ç–∏–º –ø–µ—Ä–µ–º–µ—Å—Ç–∏—Ç—å raw_data.csv –≤ –ø–∞–ø–∫—É —Å –∏–º–µ–Ω–µ–º data –∏ –∏–∑–º–µ–Ω–∏—Ç—å –∏–º—è –Ω–∞—à–µ–≥–æ —Ñ–∞–π–ª–∞ –Ω–∞ raw_data_2019.csv. –ú—ã –º–æ–≥–ª–∏ –±—ã —Å–¥–µ–ª–∞—Ç—å —ç—Ç–æ —Å –ø–æ–º–æ—â—å—é —ç—Ç–æ–≥–æ –∫–æ–¥:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç:

"–ö–∞—Ä—å–µ—Ä–∞ –ö–∞—Ä–º–∞ –≤–æ—à–ª–∞ –≤ –º–æ—é –∂–∏–∑–Ω—å, –∫–æ–≥–¥–∞ —è –±–æ–ª—å—à–µ –≤—Å–µ–≥–æ –≤ –Ω–µ–π –Ω—É–∂–¥–∞–ª–∞—Å—å, –∏ –±—ã—Å—Ç—Ä–æ –ø–æ–º–æ–≥–ª–∞ –º–Ω–µ —Å—ã–≥—Ä–∞—Ç—å –≤ –±—É—Ç–∫–µ–º–ø–µ. –ß–µ—Ä–µ–∑ –¥–≤–∞ –º–µ—Å—è—Ü–∞ –ø–æ—Å–ª–µ –≤—ã–ø—É—Å–∫–∞ —è –Ω–∞—à–ª–∞ —Ä–∞–±–æ—Ç—É —Å–≤–æ–µ–π –º–µ—á—Ç—ã, –∫–æ—Ç–æ—Ä–∞—è —Å–æ–æ—Ç–≤–µ—Ç—Å—Ç–≤–æ–≤–∞–ª–∞ –º–æ–∏–º —Ü–µ–Ω–Ω–æ—Å—Ç—è–º –∏ —Ü–µ–ª—è–º –≤ –∂–∏–∑–Ω–∏! "

–í–µ–Ω–µ—Ä–∞, –∏–Ω–∂–µ–Ω–µ—Ä-–ø—Ä–æ–≥—Ä–∞–º–º–∏—Å—Ç –≤ Rockbot

< p> –ö–æ–≥–¥–∞ –º—ã —É–∫–∞–∑—ã–≤–∞–µ–º –º–µ—Å—Ç–æ –Ω–∞–∑–Ω–∞—á–µ–Ω–∏—è –¥–ª—è –Ω–∞—à–µ–≥–æ –Ω–æ–≤–æ–≥–æ —Ñ–∞–π–ª–∞, –º—ã —Ç–∞–∫–∂–µ —É–∫–∞–∑—ã–≤–∞–µ–º –Ω–æ–≤–æ–µ –∏–º—è –¥–ª—è –Ω–∞—à–µ–≥–æ —Ñ–∞–π–ª–∞. –ú—ã —É–∫–∞–∑—ã–≤–∞–µ–º –º–µ—Å—Ç–æ –Ω–∞–∑–Ω–∞—á–µ–Ω–∏—è data / raw_data_2019.csv. –≠—Ç–æ –æ–∑–Ω–∞—á–∞–µ—Ç, —á—Ç–æ –ø—Ä–∏ –ø–µ—Ä–µ–º–µ—â–µ–Ω–∏–∏ –Ω–∞—à–µ–≥–æ —Ñ–∞–π–ª–∞ –æ–Ω –±—É–¥–µ—Ç –º–æ–∂–Ω–æ –ø–µ—Ä–µ–º–µ—Å—Ç–∏—Ç—å –≤ –∫–∞—Ç–∞–ª–æ–≥ data. –ù–æ–≤–æ–º—É —Ñ–∞–π–ª—É –±—É–¥–µ—Ç –ø—Ä–∏—Å–≤–æ–µ–Ω–æ –∏–º—è raw_datra_2019.csv.

–ü–µ—Ä–µ–º–µ—Å—Ç–∏—Ç—å –Ω–µ—Å–∫–æ–ª—å–∫–æ —Ñ–∞–π–ª–æ–≤

–ú—ã —Ç–∞–∫–∂–µ –º–æ–∂–µ–º –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Ñ—É–Ω–∫—Ü–∏—é shutil.move () –¥–ª—è –ø–µ—Ä–µ–º–µ—â–µ–Ω–∏—è –Ω–µ—Å–∫–æ–ª—å–∫–∏—Ö —Ñ–∞–π–ª–æ–≤. –î–ª—è —ç—Ç–æ–≥–æ –º—ã —Ç–∞–∫–∂–µ —Å–æ–±–∏—Ä–∞–µ–º—Å—è —Å—Å—ã–ª–∞—Ç—å—Å—è –Ω–∞ –±–∏–±–ª–∏–æ—Ç–µ–∫—É –û–°. –ú—ã –º–æ–∂–µ–º –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å os.listdir () < / em>, —á—Ç–æ–±—ã –ø–æ–ª—É—á–∏—Ç—å —Å–ø–∏—Å–æ–∫ —Ñ–∞–π–ª–æ–≤ –≤ –∫–∞—Ç–∞–ª–æ–≥–µ.

–ü—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, –º—ã —Ö–æ—Ç–∏–º –ø–µ—Ä–µ–º–µ—Å—Ç–∏—Ç—å –≤—Å–µ —Ñ–∞–π–ª—ã –≤ –∫–∞—Ç–∞–ª–æ–≥–µ / home / –∫–∞—Ä—å–µ—Ä–∞_–∫–∞—Ä–º–∞ / –¥–∞–Ω–Ω—ã–µ –≤ –Ω–æ–≤—ã–π –∫–∞—Ç–∞–ª–æ–≥ —Å –∏–º–µ–Ω–µ–º / home / care_karma / old_data. –ö–∞—Ç–∞–ª–æ–≥ data —Å–æ–¥–µ—Ä–∂–∏—Ç —Å–ª–µ–¥—É—é—â–∏–µ —Ñ–∞–π–ª—ã:

  • / home / –∫–∞—Ä—å–µ—Ä–∞_–∫–∞—Ä–º–∞ / data / data. .csv
  • /home/career_karma/data/old_data.csv

–ú—ã –º–æ–≥–ª–∏ –±—ã —Å–¥–µ–ª–∞—Ç—å —ç—Ç–æ —Å –ø–æ–º–æ—â—å—é —Å–ª–µ–¥—É—é—â–µ–≥–æ –∫–æ–¥–∞:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç:

–î–∞–≤–∞–π—Ç–µ —Ä–∞–∑–±–µ—Ä–µ–º –Ω–∞—à –∫–æ–¥. –°–Ω–∞—á–∞–ª–∞ –º—ã –∏–º–ø–æ—Ä—Ç–∏—Ä—É–µ–º –±–∏–±–ª–∏–æ—Ç–µ–∫–∏ shutil –∏ os –≤ –Ω–∞—à—É –ø—Ä–æ–≥—Ä–∞–º–º—É. –ó–∞—Ç–µ–º –º—ã —É–∫–∞–∑—ã–≤–∞–µ–º –∞–±—Å–æ–ª—é—Ç–Ω—ã–µ –ø—É—Ç–∏ –∫ –ø–∞–ø–∫–µ, —Å–æ–¥–µ—Ä–∂–∏–º–æ–µ –∫–æ—Ç–æ—Ä–æ–π –º—ã —Ö–æ—Ç–∏–º –ø–µ—Ä–µ–º–µ—Å—Ç–∏—Ç—å. –ú—ã —Ç–∞–∫–∂–µ —É–∫–∞–∑—ã–≤–∞–µ–º –ø—É—Ç—å –∫ –º–µ—Å—Ç—É –Ω–∞–∑–Ω–∞—á–µ–Ω–∏—è, –≤ –∫–æ—Ç–æ—Ä–æ–µ –¥–æ–ª–∂–Ω–æ –±—ã—Ç—å –ø–µ—Ä–µ–º–µ—â–µ–Ω–æ —Å–æ–¥–µ—Ä–∂–∏–º–æ–µ –Ω–∞—à–µ–π –ø–∞–ø–∫–∏.

–ó–∞—Ç–µ–º –º—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º os.listdir () –¥–ª—è –ø–æ–ª—É—á–µ–Ω–∏—è —Å–ø–∏—Å–∫–∞ –≤—Å–µ—Ö —Ñ–∞–π–ª–æ–≤ –≤ –ø–∞–ø–∫–µ, —Å–æ–¥–µ—Ä–∂–∏–º–æ–µ –∫–æ—Ç–æ—Ä—ã—Ö –º—ã —Ö–æ—Ç–∏–º –ø–µ—Ä–µ–º–µ—Å—Ç–∏—Ç—å. –ú—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º Python for loop –¥–ª—è –ø–µ—Ä–µ–±–æ—Ä–∞ –∫–∞–∂–¥–æ–≥–æ –∏–∑ —ç—Ç–∏—Ö —Ñ–∞–π–ª–æ–≤. –ó–∞—Ç–µ–º –º—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º shutil.move () –¥–ª—è –ø–µ—Ä–µ–º–µ—â–µ–Ω–∏—è –∫–∞–∂–¥—ã–π –æ—Ç–¥–µ–ª—å–Ω—ã–π —Ñ–∞–π–ª –≤ –Ω–∞—à—É —Ü–µ–ª–µ–≤—É—é –ø–∞–ø–∫—É.

–í –Ω–∞—à–µ–π —Ñ—É–Ω–∫—Ü–∏–∏ move () –º—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º —Å—Ç—Ä–æ–∫—É f, —á—Ç–æ–±—ã —É–∫–∞–∑–∞—Ç—å –ø–æ–ª–Ω—ã–π –ø—É—Ç—å –∫ —Ñ–∞–π–ª—É –º—ã —Ö–æ—Ç–∏–º –ø–µ—Ä–µ–º–µ—Å—Ç–∏—Ç—å. –ù–∞—à –∫–æ–¥ –æ—Ç–æ–±—Ä–∞–∂–∞–µ—Ç –ø—É—Ç—å –∫ –Ω–∞—à–∏–º –Ω–µ–¥–∞–≤–Ω–æ –ø–µ—Ä–µ–º–µ—â–µ–Ω–Ω—ã–º —Ñ–∞–π–ª–∞–º.

–ó–∞–∫–ª—é—á–µ–Ω–∏–µ

–§—É–Ω–∫—Ü–∏—è shutil.move () –ø–µ—Ä–µ–º–µ—â–∞–µ—Ç —Ñ–∞–π–ª –∏–∑ –æ–¥–Ω–æ–≥–æ –º–µ—Å—Ç–∞ –≤ –¥—Ä—É–≥–æ–µ –Ω–∞ –≤–∞—à–µ–º –∫–æ–º–ø—å—é—Ç–µ—Ä–µ. –í—ã –¥–æ–ª–∂–Ω—ã —É–∫–∞–∑–∞—Ç—å –ø—É—Ç—å –∫ —Ñ–∞–π–ª—É, –∫–æ—Ç–æ—Ä—ã–π –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø–µ—Ä–µ–º–µ—Å—Ç–∏—Ç—å, –∞ —Ç–∞–∫–∂–µ –Ω–æ–≤—ã–π –ø—É—Ç—å –¥–ª—è —Ñ–∞–π–ª–∞.

–•–æ—Ç–∏—Ç–µ —É–∑–Ω–∞—Ç—å –±–æ–ª—å—à–µ –æ –∫–æ–¥–∏—Ä–æ–≤–∞–Ω–∏–∏ –Ω–∞ Python? –£—Å—Ç–∞–Ω–æ–≤–∏—Ç–µ —Ñ–ª–∞–∂–æ–∫ –∏–∑ –Ω–∞—à–µ–≥–æ —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–∞ –ø–æ –∏–∑—É—á–µ–Ω–∏—é Python . –í—ã & r squo; –≤ —ç—Ç–æ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ –≤—ã –Ω–∞–π–¥–µ—Ç–µ —Å–æ–≤–µ—Ç—ã —ç–∫—Å–ø–µ—Ä—Ç–æ–≤ –ø–æ –∏–∑—É—á–µ–Ω–∏—é Python. –ù–∞—à–µ —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–æ —Ç–∞–∫–∂–µ —Å–æ–¥–µ—Ä–∂–∏—Ç —Å–ø–∏—Å–æ–∫ –ª—É—á—à–∏—Ö —É—á–µ–±–Ω—ã—Ö —Ä–µ—Å—É—Ä—Å–æ–≤, –∫–æ—Ç–æ—Ä—ã–µ –ø–æ–º–æ–≥—É—Ç –≤–∞–º —Ä–∞—Å—à–∏—Ä–∏—Ç—å —Å–≤–æ–∏ –∑–Ω–∞–Ω–∏—è.

Shop

Learn programming in R: courses

$

Best Python online courses for 2022

$

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers


Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method