Pi schreef op 22/05/2018 21:06:
import os
files = []
def find_db(paths):
for path in paths.split():
for root, dirs, filenames in os.walk(path):
for name in filenames:
if name.endswith((".db", ".sqlite", ".sqlite3")):
files.append(
On 22/05/18 20:06, Pi wrote:
> works fine, but only for one path. And I need to use more than one path.
> With one path given works great:
>
> >>> find_db("/dbbs")
> ['april.db, /dbbs/analysis/april.db', 'important.sqlite,
> /dbbs/temp/important.sqlite', 'march.db, /dbbs/analysis/march.db',
Hello Tutor,
I'm stuck and i really need help. Google and I can't find answer for my
problem. I've wrote app searching through directories database files. It
works fine, but only for one path. And I need to use more than one path.
This is my code:
import os
files = []
def find_db(paths):
"Christopher Spears" <[EMAIL PROTECTED]> wrote> for
root,dirs,files in os.walk(base):
> for name in files:
> path = os.path.join(root, name)
> print path
>
> Sample output:
>
> ./gui_screenshot.jpeg
> ./find_items.pyc
> ./find_items.py
> ./os
> ./LearningToProgram/loggablebankaccount.py
> I'm gl
I'm creating a function that traverses a directory
tree and prints out paths to files:
#!/usr/bin/python
import os, os.path, glob
def traverse(base = '.'):
for root,dirs,files in os.walk(base):
for name in files:
path = os.path.join(root, name)