I want to implement a check if import pdblp
is active and if not exit
the session.
I note from this link (Bloomberg Anywhere + pdblp or xbbg + not logged in) that a session:
- remains logged in for 3 days.
- is logged out if a session is opened on another pc.
Therefore, i want to implement a try-execpt
block like this:
import pdblp
# check if connected
try:
con = pdblp.BCon(timeout=5000)
con.start()
except Exception as e:
print('not logged in:', e)
my question is, would the above be sufficient to validate the connection ?
(ie. would the above throw an error, e
).