Copy, Move & Rename files & folders using python |

Поделиться
HTML-код
  • Опубликовано: 13 сен 2024
  • In this tutorial we will be learning how can we
    * copy files in python
    * copy folders using python
    * move files and folders using python
    * Rename files and folders using python
    for these, we will be using os and shutil modules
    #os #shutil #pathlib #copy #move #rename #filehandling #python #pythonprogramming #pythonlearning #files #modules #automation
    python write to file
    python read file
    python open file
    python check if file exists
    python delete file
    python copy file
    python read file line by line
    python read text file
    python write to text file
    python append file
    python move file
    python rename file
    #pythonguru python guru

Комментарии • 12

  • @amsfang2439
    @amsfang2439 Год назад

    Very Helpful tutorial, Thanks for this.🤝🏼

  • @aminamini9191
    @aminamini9191 2 года назад +1

    ♥️♥️♥️

  • @silasewert5764
    @silasewert5764 Год назад

    Solved the issue I was having. Thank you very much!

  • @punniyakotti5767
    @punniyakotti5767 3 года назад +2

    U tutorial very good, and I want to learn more about how to check naming, file extension, correct folder structure.
    Because I need to create a pipeline folders structure for my project.
    Which python shell your are using.
    Thanks
    PUNNIYAKOTTI

    • @itspyguru
      @itspyguru  3 года назад +1

      I use the normal python IDLE along with sublime text editor
      You can check for file existence with os.path.exists() method, file extension with os.path.splitext() method, folder structure with os.walk() method
      Just checkout the documentation for os module of python

    • @punniyakotti5767
      @punniyakotti5767 3 года назад

      @@itspyguru thank you so much, I will try.

  • @zhenhuachen6611
    @zhenhuachen6611 2 года назад +1

    hello. thanks i want to copy the file name with particular string/number. how to handle this situation. any method

    • @itspyguru
      @itspyguru  2 года назад

      You can use a file search method like this one
      ruclips.net/video/o3qX9oIXHFQ/видео.html

    • @zhenhuachen6611
      @zhenhuachen6611 2 года назад

      @@itspyguru thanks

  • @laurab6024
    @laurab6024 Год назад

    Hi i don't know what i'm doing wrong. I'm trying to copy a folder into another folder using copytree just like the example but i have an error: PermissionError: [Errno 13] Permission denied: 'myfolder/folder1/'
    I'm using pycharm and tried to open it as admin but still not working. If can u help me or tell me how can i fix the error :c. Thank you

    • @itspyguru
      @itspyguru  Год назад

      I can't tell it like this,but if pycharm is giving this error, try opening cmd as adminstratior and run your program from there