Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

store all files name in a folder python

import os
#this command will store all .txt files in same directories
ALL_FILES_IN_DIR = [ELEM for ELEM in os.listdir() if "txt" in ELEM]

#ALL DIRETORIES 
ALL_DIR = [ELEM for ELEM in os.listdir() if "." not in ELEM]
Comment

PREVIOUS NEXT
Code Example
Python :: pandas replace na with 0 
Python :: recursive python program to print numbers from n to 1 
Python :: string to float python pandas 
Python :: csv write without new line 
Python :: python column = sum of list of columns 
Python :: get certain columns pandas with string 
Python :: generate all parameters combination python 
Python :: python basename 
Python :: python selenium partial class name 
Python :: python: select specific columns in a data frame 
Python :: python emoji 
Python :: how to print all combinations of a string in python 
Python :: pip show all installed packages 
Python :: python finite difference approximation backward difference 
Python :: password combination python 
Python :: __name__== __main__ in python 
Python :: set axis plt python 
Python :: pyinstaller 
Python :: how to download excel file from s3 using python 
Python :: how to draw a bar graph in python 
Python :: selenium how to handle element not found python 
Python :: How to set up flash message in html template in flask app 
Python :: read pickle file python 
Python :: round list of floats python 
Python :: python datetime milliseconds 
Python :: set password on a zip file in python 
Python :: how to change kay bindings in pycharm 
Python :: Tkinter button icons 
Python :: pip fuzzywuzzy 
Python :: pandas iterate columns 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =