def save_inventory(inventory_json, save_path):
 if (INVENTORY_FILENAME == save_path):
  inventory_file = file_find(save_path)
 else:
  inventory_file = os.path.join(save_path, INVENTORY_FILENAME)
 with open(inventory_file, 'wb') as f:
  f.write(inventory_json)
  logger.info('Inventory written')

def save_inventory ( inventory_json , save_path ) : if ( INVENTORY_FILENAME == save_path ) : inventory_file = file_find ( save_path ) else : inventory_file = os . path . join ( save_path , INVENTORY_FILENAME ) with open ( inventory_file , 'wb' ) as f : f . write ( inventory_json ) logger . info ( 'Inventory written' )
save an inventory dictionary .