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', 
> 'weelky.sqlite3, /dbbs/analysis/queue/weelky.sqlite3']
> 
> 
> But with more paths gives files only for last path given:
> 
>  >>> find_db("/home/user/Desktop, /dbbs")

Note that split() will split based on whitespace so the comma
will be included in the first path. That probably renders it
invalid and so you don't get any results.

Either split by , or use strip() to remove it.

HTH
-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to