Reputation: 521
Still getting used to using python and wondering, if I wanted to have a count for the number of x
which are NOT files, how can I change this line?
teeth = [{"tooth_path": str(x)} for x in p if os.path.isfile(x)]
I still want teeth
returning what it currently is, i just want a count with how many are not files.
Upvotes: 0
Views: 67
Reputation: 1909
p = os.listdir()
sum([not os.path.isfile(f) for f in p])
Upvotes: 0