Python Forum
sub-folders in folders from text line
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sub-folders in folders from text line
#2
I don't understand the question. You can use os.mkdir to create directories. There's also os.makedirs if you want to give a path and create all intermediate directories to the leaf (i.e. like mkdir -p on the command line would do).

Also, no, you don't need to close the file - using with takes care of that for you (go and read about context managers if you're interested).
Reply


Messages In This Thread
sub-folders in folders from text line - by jenost - Mar-31-2020, 06:59 AM
RE: sub-folders in folders from text line - by ndc85430 - Mar-31-2020, 07:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using zipfile module - finding folders not files darter1010 2 442 Apr-06-2024, 07:22 AM
Last Post: Pedroski55
  What script to paste folders thenewcoder 1 743 Nov-29-2023, 09:40 AM
Last Post: Pedroski55
  Create new folders and copy files cocobolli 3 1,671 Mar-22-2023, 10:23 AM
Last Post: Gribouillis
  Copy only hidden files and folders with rsync Cannondale 2 1,117 Mar-04-2023, 02:48 PM
Last Post: Cannondale
  How do I add comments from a text-file to an array of folders? clausneergaard 2 1,885 Feb-08-2023, 07:45 PM
Last Post: Larz60+
  python move folders and subfolders not working mg24 5 2,413 Nov-09-2022, 02:24 PM
Last Post: Larz60+
  Graphic line plot with matplotlib, text file in pytho khadija 2 1,494 Aug-15-2022, 12:00 PM
Last Post: khadija
  Importing modules from different folders Tomli 3 1,538 Jun-26-2022, 10:44 AM
Last Post: snippsat
  Skipping line in text without Restarting Loop IdMineThat 4 1,610 Apr-05-2022, 04:23 AM
Last Post: deanhystad
  Find and delete above a certain line in text file cubangt 12 3,792 Mar-18-2022, 07:49 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020