-
Notifications
You must be signed in to change notification settings - Fork 4
/
hello_world.py
32 lines (23 loc) · 979 Bytes
/
hello_world.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
PURPOSE: Makes a connection to an instance of InterSystems IRIS Data Platform.
This example also stores data natively into your instance of InterSystems IRIS.
"""
import irisnative
def run():
# Credentials to connect to InterSystems IRIS database
ip = "localhost"
port = 51773
namespace = "USER"
username = "SuperUser"
password = "SYS"
# Make connection to InterSystems IRIS database
connection = irisnative.createConnection(ip, port, namespace, username, password)
print("Hello World! You have successfully connected to InterSystems IRIS.")
# Create an InterSystems IRIS native object
iris_native = irisnative.createIris(connection)
# Store data natively into a global using the InterSystems IRIS native object
iris_native.set(8888, "^testglobal", "1")
global_value = iris_native.get("^testglobal", "1")
print("The value of ^testglobal(1) is {}".format(global_value))
if __name__ == '__main__':
run()