示例#1
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()
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. 
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.
示例#5
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]
示例#6
0
 def str_generator(self, string_length=6):
     random = str(uuid.uuid4())
     random = random.upper()
     random = random.replace("-", "")
     return random[0:string_length]
 def my_random_string(self,string_length):
         random = str(uuid.uuid4())
         random = random.upper()
         random = random.replace("-","")
         return random[0:string_length]
示例#8
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.
示例#9
0
import random
import string

random = ''.join([
    random.choice(string.ascii_letters + string.digits) for n in range(10000)
])
print(random.upper())