Answers for "python os package"

3

os module

>>> import os
>>> os.getcwd()      # Return the current working directory
'C:\Python39'
>>> os.chdir('/server/accesslogs')   # Change current working directory
>>> os.system('mkdir today')   # Run the command mkdir in the system shell
0
Posted by: Guest on May-14-2021
-1

import os python

import os
os.listdir("*")[0]
Posted by: Guest on November-28-2020

Python Answers by Framework

Browse Popular Code Answers by Language