Getting Input from File


Getting input from a file involves two steps:

  1. Create a text file. Each input should be placed in a separate line.
  2. Use the function get_input(), and pass the path to the text file as the parameter. This function returns a list containing the newline-separated strings in the text file.

Example:

Input File (input-file.txt)
250
123
467
50

Main Code
x = get_input("/path-to-txt-file/input-file.txt")
info(x)
Output
[{'value': 250, 'data_type': 'Number'}, {'value': 123, 'data_type': 'Number'}, {'value': 467, 'data_type': 'Number'}, {'value': 50, 'data_type': 'Number'}]