Page 1 of 1

Python [ os ] Module Notes

Posted: Wed Jul 31, 2024 3:12 pm
by CoDeR
Python OS Module (Operating System)

Code: Select all

import os
Finding the active directory where the Python shell is running.
Python kabuğunun çalışıyor olduğu aktif dizini bulmak.

Code: Select all

os.getcwd()
Changing the active working directory.
Aktif çalışma dizinini değiştirmek.

Code: Select all

>>>os.chdir("Documents")
'/home/cn/Documents'

Code: Select all

>>>os.chdir("C:\\Users\\name surname\\Desktop")
Deleting a file.
Bir dosyayı silmek.

Code: Select all

os.remove("afile.txt")

Digital Music
Blues
Classic music
Blu-Ray and DVD
Music Tools