API Reference

adafruit_argv_file

Pass arguments to other python code files by writing them to a file before launching.

  • Author(s): Tim Cocks

Implementation Notes

Hardware:

Device must have CPSAVES or other writeable storage in order to use the library.

Software and Dependencies:

adafruit_argv_file.argv_filename(python_code_filepath: str, file_location: str = '/saves/')

Format a python code file path into its temporary argv filename.

Parameters:
  • python_code_filepath – The path to the python code file.

  • file_location – The location to write the argv file. Location must be mounted as writeable.

Returns:

The argv filename.

adafruit_argv_file.read_argv(python_code_filepath: str, file_location: str = '/saves/') list | None

Read the argv file and return the values from it as a list. Deletes the argv file after reading so that the same values won’t be re-used multiple times.

Parameters:
  • python_code_filepath – The path to the python code file to read the argv file for.

  • file_location – The location to read the argv file from.

Returns:

List of values read from the argv file or None if the argv file wasn’t read.

adafruit_argv_file.write_argv(python_code_filepath: str, argument_list: list, file_location: str = '/saves/') None

Write a list of values into an argv file for a specified python code file.

Parameters:
  • python_code_filepath – The path to the python code file to write the argv file for.

  • argument_list – The list of argument values to write.

  • file_location – The location to write the argv file to. Location must be mounted as writeable.

Returns:

None