I am attempting to pass the results of an expression to another expression. Here is an example of the code I am working with. For reference, this is for connecting to Packet.com to automate spinning up VMs. If I am wrong with my terminology, please forgive me:
import packet
from packet.IPAddress import IPAddress
manager = packet.Manager(auth_token="myapitoken")
params = {
'per_page': 50
}
device_list = manager.list_devices(project_id='myprojectid', params=params)
print(device_list)The print function will give me an output containing the VM's UUID:Output:[Device: UUID]What I would like to do instead is take that info, remove 'Device: ' and pass it to another expression so that I can pull data about the VM. Currently, I have to manually enter the devices UUID in as a string:device = manager.get_device('UUID')
ip = device.ip_addresses
print(ip)How do I pass the results of device_list formatted without [Device: '] to manager.get_device()?
