4.6.6 Verify the Installation of Windows Client
Once OML4Py is installed, you can connect your Python session to the OML4Py server. This connection enables your Python environment to access data stored in your Oracle AI Database or Autonomous AI Database schema, while also leveraging the database server's processing power, memory, and storage through the OML4Py interface.
- In your local Python session, connect to the OML4Py server
and invoke the same function by name. In the following example, replace the values
for the parameters with those for your
database.
import oml oml.connect(user='oml_user', password='oml_user_password', host='myhost', port=1521, service_name=myservicename) - Create a user-defined Python function and store it in the OML4Py script
repository.
oml.script.create("TEST", func='def func():return 1 + 1', overwrite=True) - Call the user-defined function, using the
oml.do_evalfunction.res = oml.do_eval(func='TEST') res2 - When you are finished testing, you can drop the
test.
oml.script.drop("TEST")