Skip to content

TM1 logins and logouts #983

Answered by MariusWirtz
raulpkd asked this question in Q&A
Discussion options

You must be logged in to vote

When you have multiple interactions with TM1 (e.g. data retrieval or writeback) from the same Python script there is no need to login for each operation separately.
Here is an example.

from TM1py.Services.TM1Service import TM1Service

tm1_params = {...}

with TM1Service(**tm1_params) as tm1:
    cells = {('e1', 'e2'): 1}
    tm1.cells.write_values("c1", cells)

    cells = {('e1', 'e2'): 2}
    tm1.cells.write_values("c1", cells)
    
    cells = {('e1', 'e2'): 3}
    tm1.cells.write_values("c1", cells)

Does that answer your question?

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by raulpkd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants