![]() ![]() I'm going to use a file titled sample.pdf in this tutorial's examples. To do that, we will be using the copy() function from the shutil module. Let's start with our first operation, that is, copying files. In order to make use of this module, all you need to do is import the module: shutil already comes with your Python installation, so you don't need to manually install it. ![]() Shutil (Shell Utilities) is the name of the module we will be using in this tutorial to carry out different file and directory operations. Ready? Let's then get to the point and start doing interesting stuff with our files and directories using Python! shutil Do you remember how many times you copied that specific file? Oh, or when you renamed the file you downloaded from some website because it had a meaningless name? Those are some types of operations I'm going to discuss in this tutorial. In this tutorial, I will go further and discuss different operations we can perform on files and directories (folders).įor instance, we use files a lot, and working with files goes beyond just opening and closing the file. In a previous tutorial, I discussed how we can read, open, close, and write to files.
0 Comments
Leave a Reply. |