Monday, 23 January 2023

Python Directories

 #!/usr/bin/python
import os

# Create a directory "test"
os.mkdir("test")

 

#!/usr/bin/python
import os

# This would give location of the current directory
os.getcwd() 


#!/usr/bin/python
import os

# Changing a directory to "/home/newdir"
os.chdir("/home/newdir")


#!/usr/bin/python
import os

# This would  remove "/tmp/test"  directory.
os.rmdir( "test"  )

No comments:

Kiro - Core Features

What is Kiro Kiro is an innovative AI-powered IDE that revolutionizes software development through intelligent assistance and structured wor...