Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python how to get every name in folder

import os
for name in os.listdir("."):
  if os.path.isdir(name):
    print(str(name))
Comment

python how to get the folder name of a file

# Basic syntax:
import os
os.path.dirname('/path/to/your/favorite/file.txt')
--> '/path/to/your/favorite/'
Comment

PREVIOUS NEXT
Code Example
Python :: rerun file after change python 
Python :: how to clear command prompt python 
Python :: how to change the rate of speech in pyttsx3 
Python :: python send email outlook 
Python :: saving a pandas dataframe as a csv 
Python :: python 3 play sound 
Python :: number pyramid pattern in python 
Python :: python os exists 
Python :: add download directory selenium python 
Python :: python every other including first 
Python :: Why do we use graphs? 
Python :: python global site packages 
Python :: flask api response code 
Python :: python default input 
Python :: make column nullable django 
Python :: python math cube root 
Python :: convert hex to decimal python 
Python :: static dirs django 
Python :: drop na in pandas 
Python :: how to reapete the code in python 
Python :: python get filename without extension 
Python :: char list to string python 
Python :: get information about dataframe 
Python :: how to reomve certain row from dataframe pandas 
Python :: python iterate over object fields 
Python :: python remove duplicates from a list 
Python :: scikit learn split data set 
Python :: how to find the version of python command linw 
Python :: python pop up box 
Python :: powershell get list of groups and members 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =