# How to omit specific directories, while logging code

**URL:** <https://community.wandb.ai/t/how-to-omit-specific-directories-while-logging-code/8441>\
**Category:** W&B Help\
**Tags:** wandb\
**Created:** [November 20, 2024, 5:20pm UTC](https://community.wandb.ai/t/how-to-omit-specific-directories-while-logging-code/8441 "2024-11-20T17:20:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![poornima-dharamdasan](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@poornima-dharamdasan](https://community.wandb.ai/u/poornima-dharamdasan)\
**Post date:** [November 20, 2024, 5:20pm UTC](https://community.wandb.ai/t/how-to-omit-specific-directories-while-logging-code/8441/1 "2024-11-20T17:20:52Z")

</div>

I am trying to log code using the following command:  
`wandb.run.log_code(".")`

However, this captures all the folders and files in the current directory. I also came across this command:  
`wandb.run.log_code(".", include_fn=lambda path: path.endswith(".py"))`

My issue is that I need to log `.py` files along with certain folders, but exclude some specific folders. Is there a way to achieve this?
