FICO
FICO Xpress Optimization Examples Repository
FICO Optimization Community FICO Xpress Optimization Home
Back to examples browserPrevious example

Python I/O driver example

Description
Python I/O driver example for the initialization of data to and from Python.

Further explanation of this example: see Chapter 'Python' in the 'Mosel Language Reference Manual'

python3_io_example.zip[download all files]

Source Files

Data Files





io_example.py

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ******************************************************
#   Mosel Python Example Problems
#   =============================
#
#   file io_example.py
#   ``````````````````
#   Python I/O driver example for the initialization of
#   data to and from Python.
#
#   (c) 2018 Fair Isaac Corporation
#       author: J.Müller
# *******************************************************

print("Values initialized to Python:")
print("  MyRange =", MyRange)
print("  A =", A)
print("Modifying data in Python...")
A = {i: 2 * i for i in MyRange if i % 2 == 0}

Back to examples browserPrevious example