Rename a folder
Write a Python program to rename a folder with `os.rename()`. Step-by-step explanation, colour-coded code and real output.
Online Learning Platform
Free tutorials, solved practice problems and interview prep for QA and automation engineers: Python, Playwright, Selenium, SQL, Git and more.
Write a Python program to rename a folder with `os.rename()`. Step-by-step explanation, colour-coded code and real output.
Write a Python program that changes file ownership with `os.chown()` where the platform supports...
Write a Python program to change a file's permissions with `os.chmod()`. Step-by-step explanation, colour-coded code and real output.
Write a Python program to print all nested files and folders with `os.walk()`. Step-by-step explanation, colour-coded code and real output.
Write a Python program to print the name, path and type (file or folder) of everything in a folder. Step-by-step explanation, colour-coded code and real output.
Write a Python program to create sample files with 10 different extensions. Step-by-step explanation, colour-coded code and real output.
Write a Python program that runs another Python script. Step-by-step explanation, colour-coded code and real output.
Write a Python program to create every folder of a path with `os.makedirs()`. Step-by-step explanation, colour-coded code and real output.
Write a Python program to scan a folder and print all file names with `os.scandir()`. Step-by-step explanation, colour-coded code and real output.
Write a Python program to change the current working directory. Step-by-step explanation, colour-coded code and real output.
Write a Python program to get the size of a file in bytes. Step-by-step explanation, colour-coded code and real output.
Write a Python program to check read and write permission on a path with `os.access()`. Step-by-step explanation, colour-coded code and real output.
Take free timed mock tests with answers and explanations.