You want to save Table data for a number of devices so you can post-process the information at a later time.
The Table widget includes a savexml() method for this purpose. The savexml() method allows you to specify a destination file path, and optionally include the device hostname and activity timestamp with the name. You can also control the format of the timestamp using standard strftime format.
Let's say that you've got a list of devices that you want to loop through and collect Transceiver data (Xcvr).
Your program starts out looking like the following "skeleton-code". You have a list of device hostnames, and you prompt the user for their username and password. You then loop through the hostnames, making a connection to the remote device. We call this "skeleton-code" since it really doesn't do anything, it's just a skeleton for adding our functionality into the main loop, as you will see.
'connecting to %s ... '
# log_xcvr_data( dev )
Running this program at this point results in the output:
[jeremy@linux]$ python xcvr_demo.py
connecting to mx240.chi ... ok.
connecting to mx480.chi ... ok.
connecting to mx80.chi ... ok.
connecting to srx3400.chi ... ok.
Now let's add the collecting and logging of Xcvr data to the skeleton. We'll create a function called log_xcvr_data() and pass that function the device, like this:
Once this program executes, we can examine the contents of that directory:
Here you can see that the <hostname> and <timestamp> values have been embedded into each filename.
You can later import these XML data files back into a Table widget for post processing. That process is described in a "How-To" found here.