from datetime import datetime
now = datetime.now().strftime("%Y%m%d%H%M%S%f")[:-3]
def param_genrate(str_prefix=None, str_suffix=None):
if str_prefix == None and str_suffix == None:
return now
elif str_prefix != None and str_suffix == None:
try:
param = str_prefix + now
except Exception as e:
raise e
return param
elif str_prefix == None and str_suffix != None:
try:
param = now + str_suffix
except Exception as e:
raise e
return param
elif str_prefix != None and str_suffix != None:
try:
param = str_prefix + now + str_suffix
except Exception as e:
raise e
return param
else:
raise "input error"
print(param_genrate("ee", "qq"))