You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Tue, Apr 11, 2017, 09:26 Vittore Zen ***@***.***> wrote:
Hi,
I try to use this UniAPI (great work, thanks!)
I wrote this simple code:
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--controller', default='unifi', help='the controller address (default "unifi")')
parser.add_argument('-u', '--username', default='admin', help='the controller username (default "admin")')
parser.add_argument('-p', '--password', default='', help='the controller password')
parser.add_argument('-b', '--port', default='8443', help='the controller port (default "8443")')
parser.add_argument('-v', '--version', default='4', help='the controller base version (default "4")')
parser.add_argument('-s', '--siteid', default='default', help='the site ID, UniFi >=3.x only (default "default")')
args = parser.parse_args()
from UnifiAPI.UnifiAPI import UnifiAPI
u = UnifiAPI(args.username, args.password, debug=True)
d = u.stat_sessions()
print (d['data'][0]['mac'])
d = u.stat_sta_sessions_latest(d['data'][0]['mac'])
print (d)
But I get this error:
./test3.py -c 10.10.79.250 -u admin -p myPassword
Traceback (most recent call last):
File "./test3.py", line 21, in <module>
from UnifiAPI.UnifiAPI import UnifiAPI
File "./UnifiAPI/UnifiAPI.py", line 25
print(*args)
^
SyntaxError: invalid syntax
Can you help me?
Thanks in advance.
v.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAG7Zlaon8yseCw4i8MQt3IKjJ-JNr2yks5rux0YgaJpZM4M5q31>
.
Activity
delian commentedon Apr 11, 2017
delian commentedon Apr 11, 2017
it works with me, python3 is used. which version of python do you use?
vittore commentedon Apr 11, 2017