Ejemplo n.º 1
0
def generate_random_string(string_length=5):
    """Returns a random string of length string_length."""

    random = str(uuid.uuid4())
    random = random.upper()
    random = random.replace("-","")
    return random[0:string_length]
 def my_random_string(string_length=10):
     """Returns a random string of length string_length."""
     random = str(
         uuid.uuid4())  # Convert UUID format to a Python string.
     random = random.upper()  # Make all characters uppercase.
     random = random.replace("-", "")  # Remove the UUID '-'.
     return random[0:string_length]  # Return the random string.
Ejemplo n.º 3
0
def choose_hours():
    global price
    hours = float(input('กรอกจำนวนเวลาที่ต้องการเล่น หน่วยชม. : '))
    try :
        float(hours)
    except :
        os.system('cls')
        print('กรุณากรอกเฉพาะตัวเลข')
        choose_hours()
    if float(hours) < 10 :
        if pay == 1 :
            sum0 = (float(hours)*15)*0.9
        else:
            sum0 = float(hours)*15
    else:
        sum0 = (float(hours)*15)*0.9
    price = float(sum0)
    print('ราคาที่ต้องจ่าย',price , 'บาท')
    string_length=10
    """Returns a random string of length string_length."""
    random = str(uuid.uuid4()) 
    random = random.upper() 
    random = random.replace("-","") 
    print ('คีย์ของคุณคือ ',random[0:string_length]) 
    insertloginvip(hours,random[0:string_length])              
 def create_app_code(self, string_length=4):
     """Returns a random string of length string_length."""
     random = str(uuid.uuid4())  # Convert UUID format to a Python string.
     random = random.upper()  # Make all characters uppercase.
     random = random.replace("-", "")  # Remove the UUID '-'.
     self.application_code = random[0:string_length]  # Return the random string.
     # self.status = "In progress"
     self.save()
Ejemplo n.º 5
0
def my_random_string(string_length=12):
    """
        Функція для створення секретного коду
    """
    random = str(uuid.uuid4())
    random = random.upper()
    random = random.replace("-","")
    return random[0:string_length] 
Ejemplo n.º 6
0
def randomButNotContain(words, already):
    random = randomWord(words)
    mySet = set(list(already.replace(' ', '')))
    randomSet = set(list(random.replace(' ', '')))
    intersect = randomSet & mySet
    if len(intersect) == 0:
        return random
    else:
        return randomButNotContain(words, already)
Ejemplo n.º 7
0
def generate_random_string():
    """
    Generate a random string
    """
    random = str(uuid.uuid4())
    random = random.replace("-", "")
    tstr = str(int(time.time() * 1000))
    random = random + tstr
    return random
Ejemplo n.º 8
0
def generate_random_string():
    """
    Generate a random string
    """
    random = str(uuid.uuid4())
    random = random.replace("-","")
    tstr = str(int(time.time() * 1000))
    random = random + tstr
    return random
Ejemplo n.º 9
0
def gen_id_semaine(length=50):
        """Generate identifient semaine."""
        random = str(uuid.uuid4()).upper()
        random = random.replace('-', '')
        return random[:length]
Ejemplo n.º 10
0
def random_uid(string_length=10):
    """Returns a random string of length string_length."""
    random = str(uuid.uuid4()) # Convert UUID format to a Python string.
    random = random.upper() # Make all characters uppercase.
    random = random.replace("-","") # Remove the UUID '-'.
    return random[0:string_length] # Return the random string.
Ejemplo n.º 11
0
 def my_random_string(string_length=10):
     random = str(uuid.uuid4())
     random = random.upper()
     random = random.replace("-","")
     return random[0:string_length]
Ejemplo n.º 12
0
def tag_gen(size=5):
    random = str(uuid.uuid4())  # Convert UUID format to a Python string.
    random = random.upper()  # Make all characters uppercase.
    random = random.replace("-", "")  # Remove the UUID '-'.
    return random[0:size]  # Return the random string.
Ejemplo n.º 13
0
 def my_random_string(self,string_length=10):
   """Returns a random string of length string_length."""
   random = str(uuid.uuid4()) # Convert uuid format to python string.
   random = random.lower() # Make all characters uppercase.
   random = random.replace("-","") # Remove the uuid '-'.
   return random[0:string_length] # Return the random string.
def tag_gen(size=5):
    random = str(uuid.uuid4()) # Convert UUID format to a Python string.
    random = random.upper() # Make all characters uppercase.
    random = random.replace("-","") # Remove the UUID '-'.
    return random[0:size] # Return the random string. 
Ejemplo n.º 15
0
 def str_generator(self, string_length=6):
     random = str(uuid.uuid4())
     random = random.upper()
     random = random.replace("-", "")
     return random[0:string_length]
Ejemplo n.º 16
0
 def my_random_string(self,string_length):
         random = str(uuid.uuid4())
         random = random.upper()
         random = random.replace("-","")
         return random[0:string_length]
Ejemplo n.º 17
0
def random_uuid(string_length=14):

    random = str(uuid.uuid4())
    random = random.replace("-","")
    
    return random[0:string_length]
Ejemplo n.º 18
0
def Random_Password(string_length = 10):    #The string_length can change like print(Random_Password(6)), and the length will be 6
    random = str(uuid.uuid4())
    random = random.replace("-", "")
    Device_password = random[0:string_length]
    return  Device_password
Ejemplo n.º 19
0
def my_random_string(string_length):  # Random string generation for making id
    random = str(uuid4())
    random = random.upper()
    random = random.replace("-", "")
    return random[0:string_length]
Ejemplo n.º 20
0
    def get_random_string(N):

        random = str(uuid.uuid4())  # Convert UUID format to a Python string.
        random = random.upper()  # Make all characters uppercase.
        random = random.replace("-", "")  # Remove the UUID '-'.
        return random[0:N]
Ejemplo n.º 21
0
def random_uuid(string_length=14):

    random = str(uuid.uuid4())
    random = random.replace("-", "")

    return random[0:string_length]