Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
複数の既存のフォルダ内に新しいフォルダを作成する方法を探しています。たとえば、フォルダa、b、cなどがあり、これらの既存の各フォルダ内に新しいフォルダを作成し、Pythonスクリプトを使用して新しいフォルダにa1、b1、c1、などの名前を付けます。
リストを渡すのではなく、フォルダーのリストをループしてみてください。これは最もクリーンな方法ではありませんが、次のようなことができます。
parents = [p1, p2, p3] childern = [c1, c2, c3] for p in parents: for c in children: os.mkdir(os.path.join(p,c))