Forum Archive

uuid?

ellie_ff1493

is there any unique identifier in pythonista i can use to identify devices? im making a game with lan multiplayer and want the sever to remember the device

JonB

One approach would be to have the server generate a uuid (using uuid module), then have client store that in the keychain module, or as a file.

There are also ways to get a device specific uuid, but it is not guaranteed to be persistent.

cvp

@ellie_ff1493 perhaps use this

from objc_util import *
device = ObjCClass('UIDevice').currentDevice()
print(device.name())

Édit: if I correctly undersand here, this should be unique per device

print(device.identifierForVendor())
ellie_ff1493

thx you two, will look in to them