+ """Function to save persistent variables to a file."""
+
+ # try to open the variable file
+ try:
+ file_descriptor = file(variable_file, "w")
+
+ # failing that, make the directory in which it resides first
+ except IOError:
+ os.makedirs(os.sep.join(variable_file.split(os.sep)[:-1]))
+ file_descriptor = file(variable_file, "w")
+
+ # now write the data and close out the file