Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Recursively create a file
#2
Strong recommendation: learn about lists and how to iterate them. You code could be around 30 lines...

To make an empty file: just use
open('filename.dat','w').close()
(note that unlike "touch" this will overwrite an existing file...)
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply


Messages In This Thread
Recursively create a file - by digitalquake - Nov-02-2016, 12:00 PM
RE: Recursively create a file - by Ofnuts - Nov-02-2016, 05:21 PM
RE: Recursively create a file - by digitalquake - Nov-02-2016, 06:16 PM
RE: Recursively create a file - by Ofnuts - Nov-02-2016, 06:33 PM
RE: Recursively create a file - by digitalquake - Nov-03-2016, 10:02 AM
RE: Recursively create a file - by wavic - Nov-03-2016, 11:08 AM
RE: Recursively create a file - by Ofnuts - Nov-03-2016, 02:10 PM
RE: Recursively create a file - by digitalquake - Nov-03-2016, 04:29 PM
RE: Recursively create a file - by Ofnuts - Nov-03-2016, 10:26 PM
RE: Recursively create a file - by digitalquake - Nov-09-2016, 06:35 PM
RE: Recursively create a file - by digitalquake - Nov-14-2016, 03:44 PM
RE: Recursively create a file - by metulburr - Nov-14-2016, 04:08 PM
RE: Recursively create a file - by digitalquake - Nov-25-2016, 10:43 AM
RE: Recursively create a file - by Ofnuts - Nov-25-2016, 02:52 PM
RE: Recursively create a file - by digitalquake - Nov-25-2016, 03:46 PM
RE: Recursively create a file - by nilamo - Dec-06-2016, 07:59 PM
RE: Recursively create a file - by Ofnuts - Nov-25-2016, 10:07 PM
RE: Recursively create a file - by digitalquake - Nov-28-2016, 09:27 AM
RE: Recursively create a file - by digitalquake - Dec-07-2016, 11:22 AM
RE: Recursively create a file - by Larz60+ - Dec-07-2016, 06:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Modifying a dictionary recursively SpongeB0B 2 357 May-12-2024, 04:09 PM
Last Post: Gribouillis
  Create Choices from .ods file columns cspower 3 841 Dec-28-2023, 09:59 PM
Last Post: deanhystad
  Recommended way to read/create PDF file? Winfried 3 3,157 Nov-26-2023, 07:51 AM
Last Post: Pedroski55
  Use PM4PY and create working file thomaskissas33 0 854 Nov-14-2023, 06:53 AM
Last Post: thomaskissas33
  Create csv file with 4 columns for process mining thomaskissas33 3 946 Nov-06-2023, 09:36 PM
Last Post: deanhystad
  create exe file for linux? korenron 2 1,098 Mar-22-2023, 01:42 PM
Last Post: korenron
  my first file won't create itself MehHz2526 2 1,023 Nov-27-2022, 12:58 AM
Last Post: MehHz2526
  Create multiple/single csv file for each sql records mg24 6 1,627 Sep-29-2022, 08:06 AM
Last Post: buran
Sad pandas writer create "corrupted" file freko75 1 3,067 Jun-14-2022, 09:57 PM
Last Post: snippsat
  How to return the next page from json recursively? sandson 0 1,272 Apr-01-2022, 11:01 PM
Last Post: sandson

Forum Jump:

User Panel Messages

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