You haven't said if you are using ndb, or db, however in both cases the key is a property of the entity. Prior to the put it may be incomplete, in addition with ndb with key is the returned value of the put() call
key = myobj.put()
# if you are using ndb you can get the key with
myobj.key
# if db use
myobj.key()
I suggest you also have a read of the docs on keys - https://developers.google.com/appengine/docs/python/ndb/entities