Skip to main content

Printing each items in list (nested or not) on new line with or without required tab spaces and the data will be sent to the required file or output screen depending on the file object argument

Project description

  1. This function takes a positional arguments called "the_list","indent" and "level", 'the_list' is any Python list (of - possibly - nested lists). Each data item in the provided list is (recursively) printed to the screen on it's own line.
  2. A second argument 'indent' is set to default value 'False', which means indentation or tab-stops are not required by default. If user wants to add indentation while printing the nested list it should be set to 'True'.
  3. A Third argument 'level' is used to insert required number of tab_stops when nested list is encountered.
  4. Fourth argument 'fh' is used to specify where the output of this function should write (place to write your data to), a default value of this argument is sys.stdout so that it continues to write to the screen if no file object is specified when the function is invoked.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nester_with_fileObject-1.0.0.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distributions

nester_with_fileObject-1.0.0-py3.10.egg (3.3 kB view hashes)

Uploaded Source

nester_with_fileObject-1.0.0-py3-none-any.whl (2.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page