【python selenium】生成唯一鍵

  由於自動化的需要,需要生成唯一鍵,好校驗數據庫,代碼如下:

    import  time

    def create_id(self):
        return int(time.time())

 

進一步,生成唯一的手機號碼:

    def create_mobile(self):
        return u'135' + str(int(time.time())).split('15')[1]

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章