python Heroku喜欢ha句随机名称生成器

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python Heroku喜欢ha句随机名称生成器相关的知识,希望对你有一定的参考价值。

import random

adjs = [
    "autumn", "hidden", "bitter", "misty", "silent", "empty", "dry", "dark",
    "summer", "icy", "delicate", "quiet", "white", "cool", "spring", "winter",
    "patient", "twilight", "dawn", "crimson", "wispy", "weathered", "blue",
    "billowing", "broken", "cold", "damp", "falling", "frosty", "green",
    "long", "late", "lingering", "bold", "little", "morning", "muddy", "old",
    "red", "rough", "still", "small", "sparkling", "throbbing", "shy",
    "wandering", "withered", "wild", "black", "young", "holy", "solitary",
    "fragrant", "aged", "snowy", "proud", "floral", "restless", "divine",
    "polished", "ancient", "purple", "lively", "nameless", "teal", "charming",
    "lush", "tropical", "stunning", "thriving", "fluffy", "gentle", "enigmatic"
  ]

nouns = [
    "waterfall", "river", "breeze", "moon", "rain", "wind", "sea", "morning",
    "snow", "lake", "sunset", "pine", "shadow", "leaf", "dawn", "glitter",
    "forest", "hill", "cloud", "meadow", "sun", "glade", "bird", "brook",
    "butterfly", "bush", "dew", "dust", "field", "fire", "flower", "firefly",
    "feather", "grass", "haze", "mountain", "night", "pond", "darkness",
    "snowflake", "silence", "sound", "sky", "shape", "surf", "thunder",
    "violet", "water", "wildflower", "wave", "water", "resonance", "sun",
    "wood", "dream", "cherry", "tree", "fog", "frost", "voice", "paper",
    "frog", "smoke", "star"
]

def generate_haiku_name():

  adj = random.choice(adjs)
  noun = random.choice(nouns)
  rand_num = '{0:04}'.format(random.randint(1, 100000))


  haiku_name = "{0}-{1}-{2}".format(adj, noun, rand_num)

  return haiku_name


print generate_haiku_name()

以上是关于python Heroku喜欢ha句随机名称生成器的主要内容,如果未能解决你的问题,请参考以下文章

PHP简单实现一言 / 随机一句功能

随机生成双色球号码和商品管理python程序

从狗屁不通文章生成器,到机器写作之路

python 列出一句生成

如何生成随机词

在 Python 中生成随机文件名的最佳方法