Skip to content

rendhive/Library-os-Py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python OS Library Sample 🚀

A simple Python example showing how to use the built-in os library.
Learn to interact with your operating system in just a few lines of code!

What You Can Do

  • Check your current working directory 🗂️
  • Create and list folders/files 📁
  • Rename or delete files/folders ✏️❌
  • Access environment variables 🌐
  • Identify files vs folders 🔍

Quick Example

import os

print("Current Directory:", os.getcwd())

folder_name = "example_folder"
os.makedirs(folder_name, exist_ok=True)
print(f"Folder '{folder_name}' ready!")

print("Contents:", os.listdir(os.getcwd()))

print(f"'{folder_name}' is a directory" if os.path.isdir(folder_name) else "It's a file")

About

A-z lbray Phyton Referensi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages