py-3cx/demo.py

10 lines
289 B
Python

site='https://mysite.3cx.com'
user='123'
pwrd='AbCd123Ef'
import Py3CX
tcx=Py3CX.Py3CX(uri=site)
print("Am I logged in? %s" % tcx.authenticated)
tcx.authenticate(username=user, password=pwrd)
print("Am I logged in now? %s" % tcx.authenticated)
me=Py3CX.User('101')
friend=Py3CX.User('116')