What do you want to save?
Add Code snippet
New code examples
-
Python 2022-01-31 23:52:46
python read a directory to get all files in sub folders
import os path ="C:/workspace/python" #we shall store all the file names in this list filelist = [] for root, dirs, files in os.walk(path): for file in files: #append the file name to the list filelist.append(os.path.join(root,file)... Add solution -
Python 2022-01-29 11:11:56
list files python
import os print(os.listdir('/path/to/folder/to/list')) Add solution -
Python 2022-01-29 10:47:50
AttributeError: type object 'User' has no attribute 'query'
import os import sys from sqlalchemy import Column, ForeignKey, Integer, String, DateTime, Boolean, Float, Date, Table from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy import create_engine fro... Add solution -
Python 2022-01-28 19:46:06
get self file name in python
import os os.path.basename(__file__) Add solution
Best helpers
Michaelyus
+5
EBA2018
+5
Eric Lewis
+5
J. Tatum
+5
Erwaman
+5
Jp_
+5
Fauve
+5
Katy Forde
+5
Jcvamp
+5
Chris
+5
Xiaotian Pei
+5