SYSTEM

OS functions

How to create and list a folder in python ?

Jeffrin
$python3.7
Python 3.7.4 (default, Jul 11 2019, 10:43:21) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.listdir('.')
[]
>>> os.mkdir('newfolder')
>>> os.listdir('.')
['newfolder']
>>> 

Tags:
0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Back to top