Cloud Stack Ninja

apologies in advance if there is already a solution for this somewhere, I was not able to find it.

I have several numbered folders in a directory, each of them have a file "U.txt" that I would like to run a script on. So my file structures are like:


I want to recursively go into each folder. I am aware you can do this with glob, I so I can get past that part, I'm just unsure of how to save them all into one file, with their file names numbered. So I want to save the new U.txt, (which will be a .npy file), into a new folder like


Read more here:

Content Attribution

This content was originally published by user3611 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: