随机单词生成器 - 蟒蛇



所以我基本上是在做一个项目,在这个项目中,计算机从单词列表中获取一个单词并将其混杂起来供用户使用。 只有一个问题:我不想继续在列表中写大量的单词,所以我想知道是否有办法导入大量随机单词,所以即使我也不知道它是什么, 然后我也可以享受游戏吗?这是整个程序的编码,我输入的只有6个字:

import random
WORDS = ("python", "jumble", "easy", "difficult", "answer",  "xylophone")
word = random.choice(WORDS)
correct = word
jumble = ""
while word:
    position = random.randrange(len(word))
    jumble += word[position]
    word = word[:position] + word[(position + 1):]
print(
"""
      Welcome to WORD JUMBLE!!!
      Unscramble the leters to make a word.
      (press the enter key at prompt to quit)
      """
      )
print("The jumble is:", jumble)
guess = input("Your guess: ")
while guess != correct and guess != "":
    print("Sorry, that's not it")
    guess = input("Your guess: ")
if guess == correct:
    print("That's it, you guessed it!n")
print("Thanks for playing")
input("nnPress the enter key to exit")

阅读本地单词列表

如果您反复执行此操作,我会在本地下载它并从本地文件中提取。 *nix 用户可以使用 /usr/share/dict/words .

例:

word_file = "/usr/share/dict/words"
WORDS = open(word_file).read().splitlines()

从远程字典中提取

如果要从远程字典中提取,这里有几种方法。请求库使这变得非常简单(您必须pip install requests):

import requests
word_site = "https://www.mit.edu/~ecprice/wordlist.10000"
response = requests.get(word_site)
WORDS = response.content.splitlines()

或者,您可以使用内置的urllib2。

import urllib2
word_site = "https://www.mit.edu/~ecprice/wordlist.10000"
response = urllib2.urlopen(word_site)
txt = response.read()
WORDS = txt.splitlines()

Python 3 的解决方案

对于 Python3,以下代码从 Web 中获取单词列表并返回一个列表。答案基于凯尔凯利上面接受的答案。

import urllib.request
word_url = "http://svnweb.freebsd.org/csrg/share/dict/words?view=co&content-type=text/plain"
response = urllib.request.urlopen(word_url)
long_txt = response.read().decode()
words = long_txt.splitlines()

输出:

>>> words
['a', 'AAA', 'AAAS', 'aardvark', 'Aarhus', 'Aaron', 'ABA', 'Ababa',
 'aback', 'abacus', 'abalone', 'abandon', 'abase', 'abash', 'abate',
 'abbas', 'abbe', 'abbey', 'abbot', 'Abbott', 'abbreviate', ... ]

并生成(因为这是我的目标)一个列表,其中包含 1) 仅大写单词,2) 仅"类似名称"的单词,以及 3) 一种现实但听起来很有趣的随机名称:

import random
upper_words = [word for word in words if word[0].isupper()]
name_words  = [word for word in upper_words if not word.isupper()]
rand_name   = ' '.join([name_words[random.randint(0, len(name_words))] for i in range(2)])

还有一些随机名称:

>>> for n in range(10):
        ' '.join([name_words[random.randint(0,len(name_words))] for i in range(2)])
    'Semiramis Sicilian'
    'Julius Genevieve'
    'Rwanda Cohn'
    'Quito Sutherland'
    'Eocene Wheller'
    'Olav Jove'
    'Weldon Pappas'
    'Vienna Leyden'
    'Io Dave'
    'Schwartz Stromberg'

有一个包可以非常方便地实现random_word这个请求:

 $ pip install random-word
from random_word import RandomWords
r = RandomWords()
# Return a single random word
r.get_random_word()
# Return list of Random words
r.get_random_words()
# Return Word of the day
r.word_of_the_day()
网上有许多字典文件 -

如果你在Linux上,很多(所有?)发行版都带有一个/etc/dictionaryionaries-common/words文件,你可以很容易地解析(words = open('/etc/dictionaries-common/words').readlines(),例如)使用。

在线获取单词

from urllib.request import Request, urlopen
url="https://svnweb.freebsd.org/csrg/share/dict/words?revision=61569&view=co"
req = Request(url, headers={'User-Agent': 'Mozilla/5.0'})
web_byte = urlopen(req).read()
webpage = web_byte.decode('utf-8')
print(webpage)

随机化前 500 个单词

from urllib.request import Request, urlopen
import random

url="https://svnweb.freebsd.org/csrg/share/dict/words?revision=61569&view=co"
req = Request(url, headers={'User-Agent': 'Mozilla/5.0'})
web_byte = urlopen(req).read()
webpage = web_byte.decode('utf-8')
first500 = webpage[:500].split("n")
random.shuffle(first500)
print(first500)

输出

["弃绝", "有能力", "出生", "阿比盖尔", "阿比让", "燃烧", "废除", "修道院", "高于", "堕胎", "异常", "土著", "原住民", "阿伯丁", "雅培", "阿伯纳西", "反击", "减少", "可恶", "AAA", "abc", "abed", "可憎", "废除", "Ablate", "Abbey", "Abbot", "Abelson", "ABA", "Abner", "abduct", "a", "a", "abbo", "abalone", "a", "可恶的", "阿贝尔", "土豚", "奥胡斯", "阿贝", "

abjure", "abeyance", "Abel", "abetting", "abash", "AAAS", "abdicate", "缩写", "异常"、"卑鄙"、"算盘"、"沦陷"、"可憎"、"居所"、"遗弃"、"阿巴"、"阿巴"、"腹"、"教唆"、"阿巴"、"畸变"、"腹部"、"教唆"、"怂恿"、"比比皆是"、"亚伦"、"憎恶"、"沐浴"、"阿贝扬特"、"关于"]

import random
import string
letters = string.ascii_letters
x = "".join(random.sample(letters,5))
print(x)

上面,letters将包含所有ASCII字母字符(小写和大写),如下所示:

>>> print(letters)
>>> 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'

使用 random.sample 将根据您想要的数量(random.sample(<string>, <# of random parts>)为您提供给定对象(此处为string对象)的项目总数(在本例中为字符)的列表。

>>> random.sample(letters, 5)
>>> ['j', 'e', 'u', 'g', 'k']

最后

x = "".join(...)会将返回的列表连接在一起,没有空格,因为"".如果您希望每个字母之间有空格,可以将该列表更改为" ".

这里有2286个单词。

words = ["a", "ability", "able", "about", "above", "abroad", "absence", "absent", "absolute", "accept", "accident", "accord", "account", "accuse", "accustom", "ache", "across", "act", "action", "active", "actor", "actress", "actual", "add", "address", "admire", "admission", "admit", "adopt", "adoption", "advance", "advantage", "adventure", "advertise", "advice", "advise", "affair", "afford", "afraid", "after", "afternoon", "again", "against", "age", "agency", "agent", "ago", "agree", "agriculture", "ahead", "aim", "air", "airplane", "alike", "alive", "all", "allow", "allowance", "almost", "alone", "along", "aloud", "already", "also", "although", "altogether", "always", "ambition", "ambitious", "among", "amongst", "amount", "amuse", "ancient", "and", "anger", "angle", "angry", "animal", "annoy", "annoyance", "another", "answer", "anxiety", "anxious", "any", "anybody", "anyhow", "anyone", "anything", "anyway", "anywhere", "apart", "apology", "appear", "appearance", "applaud", "applause", "apple", "application", "apply", "appoint", "approve", "arch", "argue", "arise", "arm", "army", "around", "arrange", "arrest", "arrive", "arrow", "art", "article", "artificial", "as", "ash", "ashamed", "aside", "ask", "asleep", "association", "astonish", "at", "attack", "attempt", "attend", "attention", "attentive", "attract", "attraction", "attractive", "audience", "aunt", "autumn", "avenue", "average", "avoid", "avoidance", "awake", "away", "awkward", "axe", "baby", "back", "backward", "bad", "bag", "baggage", "bake", "balance", "ball", "band", "bank", "bar", "barber", "bare", "bargain", "barrel", "base", "basic", "basin", "basis", "basket", "bath", "bathe", "battery", "battle", "bay", "be", "beak", "beam", "bean", "bear", "beard", "beast", "beat", "beauty", "because", "become", "bed", "bedroom", "before", "beg", "begin", "behave", "behavior", "behind", "being", "belief", "believe", "bell", "belong", "below", "belt", "bend", "beneath", "berry", "beside", "besides", "best", "better", "between", "beyond", "bicycle", "big", "bill", "bind", "bird", "birth", "bit", "bite", "bitter", "black", "blade", "blame", "bleed", "bless", "blind", "block", "blood", "blow", "blue", "board", "boast", "boat", "body", "boil", "bold", "bone", "book", "border", "borrow", "both", "bottle", "bottom", "bound", "boundary", "bow", "bowl", "box", "boy", "brain", "branch", "brass", "brave", "bravery", "bread", "breadth", "break", "breakfast", "breath", "breathe", "bribe", "bribery", "brick", "bridge", "bright", "brighten", "bring", "broad", "broadcast", "brother", "brown", "brush", "bucket", "build", "bunch", "bundle", "burn", "burst", "bury", "bus", "bush", "business", "businesslike", "businessman", "busy", "but", "butter", "button", "buy", "by", "cage", "cake", "calculate", "calculation", "calculator", "call", "calm", "camera", "camp", "can", "canal", "cap", "cape", "capital", "captain", "car", "card", "care", "carriage", "carry", "cart", "case", "castle", "cat", "catch", "cattle", "cause", "caution", "cautious", "cave", "cent", "center", "century", "ceremony", "certain", "certainty", "chain", "chair", "chairman", "chalk", "chance", "change", "character", "charge", "charm", "cheap", "cheat", "check", "cheer", "cheese", "chest", "chicken", "chief", "child", "childhood", "chimney", "choice", "choose", "christmas", "church", "circle", "circular", "citizen", "city", "civilize", "claim", "class", "classification", "classify", "clay", "clean", "clear", "clerk", "clever", "cliff", "climb", "clock", "close", "cloth", "clothe", "cloud", "club", "coal", "coarse", "coast", "coat", "coffee", "coin", "cold", "collar", "collect", "collection", "collector", "college", "colony", "color", "comb", "combine", "come", "comfort", "command", "commerce", "commercial", "committee", "common", "companion", "companionship", "company", "compare", "comparison", "compete", "competition", "competitor", "complain", "complaint", "complete", "completion", "complicate", "complication", "compose", "composition", "concern", "condition", "confess", "confession", "confidence", "confident", "confidential", "confuse", "confusion", "congratulate", "congratulation", "connect", "connection", "conquer", "conqueror", "conquest", "conscience", "conscious", "consider", "contain", "content", "continue", "control", "convenience", "convenient", "conversation", "cook", "cool", "copper", "copy", "cork", "corn", "corner", "correct", "correction", "cost", "cottage", "cotton", "cough", "could", "council", "count", "country", "courage", "course", "court", "cousin", "cover", "cow", "coward", "cowardice", "crack", "crash", "cream", "creature", "creep", "crime", "criminal", "critic", "crop", "cross", "crowd", "crown", "cruel", "crush", "cry", "cultivate", "cultivation", "cultivator", "cup", "cupboard", "cure", "curious", "curl", "current", "curse", "curtain", "curve", "cushion", "custom", "customary", "customer", "cut", "daily", "damage", "damp", "dance", "danger", "dare", "dark", "darken", "date", "daughter", "day", "daylight", "dead", "deaf", "deafen", "deal", "dear", "death", "debt", "decay", "deceit", "deceive", "decide", "decision", "decisive", "declare", "decrease", "deed", "deep", "deepen", "deer", "defeat", "defend", "defendant", "defense", "degree", "delay", "delicate", "delight", "deliver", "delivery", "demand", "department", "depend", "dependence", "dependent", "depth", "descend", "descendant", "descent", "describe", "description", "desert", "deserve", "desire", "desk", "despair", "destroy", "destruction", "destructive", "detail", "determine", "develop", "devil", "diamond", "dictionary", "die", "difference", "different", "difficult", "difficulty", "dig", "dine", "dinner", "dip", "direct", "direction", "director", "dirt", "disagree", "disappear", "disappearance", "disappoint", "disapprove", "discipline", "discomfort", "discontent", "discover", "discovery", "discuss", "discussion", "disease", "disgust", "dish", "dismiss", "disregard", "disrespect", "dissatisfaction", "dissatisfy", "distance", "distant", "distinguish", "district", "disturb", "ditch", "dive", "divide", "division", "do", "doctor", "dog", "dollar", "donkey", "door", "dot", "double", "doubt", "down", "dozen", "drag", "draw", "drawer", "dream", "dress", "drink", "drive", "drop", "drown", "drum", "dry", "duck", "due", "dull", "during", "dust", "duty", "each", "eager", "ear", "early", "earn", "earnest", "earth", "ease", "east", "eastern", "easy", "eat", "edge", "educate", "education", "educator", "effect", "effective", "efficiency", "efficient", "effort", "egg", "either", "elastic", "elder", "elect", "election", "electric", "electrician", "elephant", "else", "elsewhere", "empire", "employ", "employee", "empty", "enclose", "enclosure", "encourage", "end", "enemy", "engine", "engineer", "english", "enjoy", "enough", "enter", "entertain", "entire", "entrance", "envelope", "envy", "equal", "escape", "especially", "essence", "essential", "even", "evening", "event", "ever", "everlasting", "every", "everybody", "everyday", "everyone", "everything", "everywhere", "evil", "exact", "examine", "example", "excellence", "excellent", "except", "exception", "excess", "excessive", "exchange", "excite", "excuse", "exercise", "exist", "existence", "expect", "expense", "expensive", "experience", "experiment", "explain", "explode", "explore", "explosion", "explosive", "express", "expression", "extend", "extension", "extensive", "extent", "extra", "extraordinary", "extreme", "eye", "face", "fact", "factory", "fade", "fail", "failure", "faint", "fair", "faith", "fall", "FALSE", "fame", "familiar", "family", "fan", "fancy", "far", "farm", "fashion", "fast", "fasten", "fat", "fate", "father", "fatten", "fault", "favor", "favorite", "fear", "feast", "feather", "feed", "feel", "fellow", "fellowship", "female", "fence", "fever", "few", "field", "fierce", "fight", "figure", "fill", "film", "find", "fine", "finger", "finish", "fire", "firm", "first", "fish", "fit", "fix", "flag", "flame", "flash", "flat", "flatten", "flavor", "flesh", "float", "flood", "floor", "flour", "flow", "flower", "fly", "fold", "follow", "fond", "food", "fool", "foot", "for", "forbid", "force", "foreign", "forest", "forget", "forgive", "fork", "form", "formal", "former", "forth", "fortunate", "fortune", "forward", "frame", "framework", "free", "freedom", "freeze", "frequency", "frequent", "fresh", "friend", "friendly", "friendship", "fright", "frighten", "from", "front", "fruit", "fry", "full", "fun", "funeral", "funny", "fur", "furnish", "furniture", "further", "future", "gaiety", "gain", "gallon", "game", "gap", "garage", "garden", "gas", "gate", "gather", "gay", "general", "generous", "gentle", "gentleman", "get", "gift", "girl", "give", "glad", "glass", "glory", "go", "goat", "god", "gold", "golden", "good", "govern", "governor", "grace", "gradual", "grain", "grammar", "grammatical", "grand", "grass", "grateful", "grave", "gray", "grease", "great", "greed", "green", "greet", "grind", "ground", "group", "grow", "growth", "guard", "guess", "guest", "guide", "guilt", "gun", "habit", "hair", "half", "hall", "hammer", "hand", "handkerchief", "handle", "handshake", "handwriting", "hang", "happen", "happy", "harbor", "hard", "harden", "hardly", "harm", "harvest", "haste", "hasten", "hat", "hate", "hatred", "have", "hay", "he", "head", "headache", "headdress", "heal", "health", "heap", "hear", "heart", "heat", "heaven", "heavenly", "heavy", "height", "heighten", "hello", "help", "here", "hesitate", "hesitation", "hide", "high", "highway", "hill", "hinder", "hindrance", "hire", "history", "hit", "hold", "hole", "holiday", "hollow", "holy", "home", "homecoming", "homemade", "homework", "honest", "honesty", "honor", "hook", "hope", "horizon", "horizontal", "horse", "hospital", "host", "hot", "hotel", "hour", "house", "how", "however", "human", "humble", "hunger", "hunt", "hurrah", "hurry", "hurt", "husband", "hut", "I", "ice", "idea", "ideal", "idle", "if", "ill", "imaginary", "imaginative", "imagine", "imitate", "imitation", "immediate", "immense", "importance", "important", "impossible", "improve", "in", "inch", "include", "inclusive", "increase", "indeed", "indoor", "industry", "influence", "influential", "inform", "ink", "inn", "inquire", "inquiry", "insect", "inside", "instant", "instead", "instrument", "insult", "insurance", "insure", "intend", "intention", "interest", "interfere", "interference", "international", "interrupt", "interruption", "into", "introduce", "introduction", "invent", "invention", "inventor", "invite", "inward", "iron", "island", "it", "jaw", "jealous", "jealousy", "jewel", "join", "joint", "joke", "journey", "joy", "judge", "juice", "jump", "just", "justice", "keep", "key", "kick", "kill", "kind", "king", "kingdom", "kiss", "kitchen", "knee", "kneel", "knife", "knock", "knot", "know", "knowledge", "lack", "ladder", "lady", "lake", "lamp", "land", "landlord", "language", "large", "last", "late", "lately", "latter", "laugh", "laughter", "law", "lawyer", "lay", "lazy", "lead", "leadership", "leaf", "lean", "learn", "least", "leather", "leave", "left", "leg", "lend", "length", "lengthen", "less", "lessen", "lesson", "let", "letter", "level", "liar", "liberty", "librarian", "library", "lid", "lie", "life", "lift", "light", "lighten", "like", "likely", "limb", "limit", "line", "lip", "lipstick", "liquid", "list", "listen", "literary", "literature", "little", "live", "load", "loaf", "loan", "local", "lock", "lodge", "log", "lonely", "long", "look", "loose", "loosen", "lord", "lose", "loss", "lot", "loud", "love", "lovely", "low", "loyal", "loyalty", "luck", "lump", "lunch", "lung", "machine", "machinery", "mad", "madden", "mail", "main", "make", "male", "man", "manage", "mankind", "manner", "manufacture", "many", "map", "march", "mark", "market", "marriage", "marry", "mass", "master", "mat", "match", "material", "matter", "may", "maybe", "meal", "mean", "meantime", "meanwhile", "measure", "meat", "mechanic", "mechanism", "medical", "medicine", "meet", "melt", "member", "membership", "memory", "mend", "mention", "merchant", "mercy", "mere", "merry", "message", "messenger", "metal", "middle", "might", "mild", "mile", "milk", "mill", "mind", "mine", "mineral", "minister", "minute", "miserable", "misery", "miss", "mistake", "mix", "mixture", "model", "moderate", "moderation", "modern", "modest", "modesty", "moment", "momentary", "money", "monkey", "month", "moon", "moonlight", "moral", "more", "moreover", "morning", "most", "mother", "motherhood", "motherly", "motion", "motor", "mountain", "mouse", "mouth", "move", "much", "mud", "multiplication", "multiply", "murder", "music", "musician", "must", "mystery", "nail", "name", "narrow", "nation", "native", "nature", "near", "neat", "necessary", "necessity", "neck", "need", "needle", "neglect", "neighbor", "neighborhood", "neither", "nephew", "nest", "net", "network", "never", "new", "news", "newspaper", "next", "nice", "niece", "night", "no", "noble", "nobody", "noise", "none", "noon", "nor", "north", "northern", "nose", "not", "note", "notebook", "nothing", "notice", "noun", "now", "nowadays", "nowhere", "nuisance", "number", "numerous", "nurse", "nursery", "nut", "oar", "obedience", "obedient", "obey", "object", "objection", "observe", "occasion", "ocean", "of", "off", "offend", "offense", "offer", "office", "officer", "official", "often", "oil", "old", "old-fashioned", "omission", "omit", "on", "once", "one", "only", "onto", "open", "operate", "operation", "operator", "opinion", "opportunity", "oppose", "opposite", "opposition", "or", "orange", "order", "ordinary", "organ", "organize", "origin", "ornament", "other", "otherwise", "ought", "ounce", "out", "outline", "outside", "outward", "over", "overcome", "overflow", "owe", "own", "ownership", "pack", "package", "pad", "page", "pain", "paint", "pair", "pale", "pan", "paper", "parcel", "pardon", "parent", "park", "part", "particle", "particular", "partner", "party", "pass", "passage", "passenger", "past", "paste", "pastry", "path", "patience", "patient", "patriotic", "pattern", "pause", "paw", "pay", "peace", "pearl", "peculiar", "pen", "pencil", "penny", "people", "per", "perfect", "perfection", "perform", "performance", "perhaps", "permanent", "permission", "permit", "person", "persuade", "persuasion", "pet", "photograph", "photography", "pick", "picture", "piece", "pig", "pigeon", "pile", "pin", "pinch", "pink", "pint", "pipe", "pity", "place", "plain", "plan", "plant", "plaster", "plate", "play", "pleasant", "please", "pleasure", "plenty", "plow", "plural", "pocket", "poem", "poet", "point", "poison", "police", "polish", "polite", "political", "politician", "politics", "pool", "poor", "popular", "population", "position", "possess", "possession", "possessor", "possible", "post", "postpone", "pot", "pound", "pour", "poverty", "powder", "power", "practical", "practice", "praise", "pray", "preach", "precious", "prefer", "preference", "prejudice", "prepare", "presence", "present", "preserve", "president", "press", "pressure", "pretend", "pretense", "pretty", "prevent", "prevention", "price", "pride", "priest", "print", "prison", "private", "prize", "probable", "problem", "procession", "produce", "product", "production", "profession", "profit", "program", "progress", "promise", "prompt", "pronounce", "pronunciation", "proof", "proper", "property", "proposal", "propose", "protect", "protection", "proud", "prove", "provide", "public", "pull", "pump", "punctual", "punish", "pupil", "pure", "purple", "purpose", "push", "put", "puzzle", "qualification", "qualify", "quality", "quantity", "quarrel", "quart", "quarter", "queen", "question", "quick", "quiet", "quite", "rabbit", "race", "radio", "rail", "railroad", "rain", "raise", "rake", "rank", "rapid", "rare", "rate", "rather", "raw", "ray", "razor", "reach", "read", "ready", "real", "realize", "reason", "reasonable", "receipt", "receive", "recent", "recognition", "recognize", "recommend", "record", "red", "redden", "reduce", "reduction", "refer", "reference", "reflect", "reflection", "refresh", "refuse", "regard", "regret", "regular", "rejoice", "relate", "relation", "relative", "relief", "relieve", "religion", "remain", "remark", "remedy", "remember", "remind", "rent", "repair", "repeat", "repetition", "replace", "reply", "report", "represent", "representative", "reproduce", "reproduction", "republic", "reputation", "request", "rescue", "reserve", "resign", "resist", "resistance", "respect", "responsible", "rest", "restaurant", "result", "retire", "return", "revenge", "review", "reward", "ribbon", "rice", "rich", "rid", "ride", "right", "ring", "ripe", "ripen", "rise", "risk", "rival", "rivalry", "river", "road", "roar", "roast", "rob", "robbery", "rock", "rod", "roll", "roof", "room", "root", "rope", "rot", "rotten", "rough", "round", "row", "royal", "royalty", "rub", "rubber", "rubbish", "rude", "rug", "ruin", "rule", "run", "rush", "rust", "sacred", "sacrifice", "sad", "sadden", "saddle", "safe", "safety", "sail", "sailor", "sake", "salary", "sale", "salesman", "salt", "same", "sample", "sand", "satisfaction", "satisfactory", "satisfy", "sauce", "saucer", "save", "saw", "say", "scale", "scarce", "scatter", "scene", "scenery", "scent", "school", "science", "scientific", "scientist", "scissors", "scold", "scorn", "scrape", "scratch", "screen", "screw", "sea", "search", "season", "seat", "second", "secrecy", "secret", "secretary", "see", "seed", "seem", "seize", "seldom", "self", "selfish", "sell", "send", "sense", "sensitive", "sentence", "separate", "separation", "serious", "servant", "serve", "service", "set", "settle", "several", "severe", "sew", "shade", "shadow", "shake", "shall", "shallow", "shame", "shape", "share", "sharp", "sharpen", "shave", "she", "sheep", "sheet", "shelf", "shell", "shelter", "shield", "shilling", "shine", "ship", "shirt", "shock", "shoe", "shoot", "shop", "shore", "short", "shorten", "should", "shoulder", "shout", "show", "shower", "shut", "sick", "side", "sight", "sign", "signal", "signature", "silence", "silent", "silk", "silver", "simple", "simplicity", "since", "sincere", "sing", "single", "sink", "sir", "sister", "sit", "situation", "size", "skill", "skin", "skirt", "sky", "slave", "slavery", "sleep", "slide", "slight", "slip", "slippery", "slope", "slow", "small", "smell", "smile", "smoke", "smooth", "snake", "snow", "so", "soap", "social", "society", "sock", "soft", "soften", "soil", "soldier", "solemn", "solid", "solution", "solve", "some", "somebody", "somehow", "someone", "something", "sometime", "sometimes", "somewhere", "son", "song", "soon", "sore", "sorrow", "sorry", "sort", "soul", "sound", "soup", "sour", "south", "sow", "space", "spade", "spare", "speak", "special", "speech", "speed", "spell", "spend", "spill", "spin", "spirit", "spit", "spite", "splendid", "split", "spoil", "spoon", "sport", "spot", "spread", "spring", "square", "staff", "stage", "stain", "stair", "stamp", "stand", "standard", "staple", "star", "start", "state", "station", "stay", "steady", "steam", "steel", "steep", "steer", "stem", "step", "stick", "stiff", "stiffen", "still", "sting", "stir", "stock", "stocking", "stomach", "stone", "stop", "store", "storm", "story", "stove", "straight", "straighten", "strange", "strap", "straw", "stream", "street", "strength", "strengthen", "stretch", "strict", "strike", "string", "strip", "stripe", "stroke", "strong", "struggle", "student", "study", "stuff", "stupid", "subject", "substance", "succeed", "success", "such", "suck", "sudden", "suffer", "sugar", "suggest", "suggestion", "suit", "summer", "sun", "supper", "supply", "support", "suppose", "sure", "surface", "surprise", "surround", "suspect", "suspicion", "suspicious", "swallow", "swear", "sweat", "sweep", "sweet", "sweeten", "swell", "swim", "swing", "sword", "sympathetic", "sympathy", "system", "table", "tail", "tailor", "take", "talk", "tall", "tame", "tap", "taste", "tax", "taxi", "tea", "teach", "tear", "telegraph", "telephone", "tell", "temper", "temperature", "temple", "tempt", "tend", "tender", "tent", "term", "terrible", "test", "than", "thank", "that", "the", "theater", "theatrical", "then", "there", "therefore", "these", "they", "thick", "thicken", "thief", "thin", "thing", "think", "thirst", "this", "thorn", "thorough", "those", "though", "thread", "threat", "threaten", "throat", "through", "throw", "thumb", "thunder", "thus", "ticket", "tide", "tidy", "tie", "tight", "tighten", "till", "time", "tin", "tip", "tire", "title", "to", "tobacco", "today", "toe", "together", "tomorrow", "ton", "tongue", "tonight", "too", "tool", "tooth", "top", "total", "touch", "tough", "tour", "toward", "towel", "tower", "town", "toy", "track", "trade", "train", "translate", "translation", "translator", "trap", "travel", "tray", "treasure", "treasury", "treat", "tree", "tremble", "trial", "tribe", "trick", "trip", "trouble", "true", "trunk", "trust", "truth", "try", "tube", "tune", "turn", "twist", "type", "ugly", "umbrella", "uncle", "under", "underneath", "understand", "union", "unit", "unite", "unity", "universal", "universe", "university", "unless", "until", "up", "upon", "upper", "uppermost", "upright", "upset", "urge", "urgent", "use", "usual", "vain", "valley", "valuable", "value", "variety", "various", "veil", "verb", "verse", "very", "vessel", "victory", "view", "village", "violence", "violent", "virtue", "visit", "visitor", "voice", "vote", "vowel", "voyage", "wage", "waist", "wait", "waiter", "wake", "walk", "wall", "wander", "want", "war", "warm", "warmth", "warn", "wash", "waste", "watch", "water", "wave", "wax", "way", "we", "weak", "weaken", "wealth", "weapon", "wear", "weather", "weave", "weed", "week", "weekday", "weekend", "weigh", "weight", "welcome", "well", "west", "western", "wet", "what", "whatever", "wheat", "wheel", "when", "whenever", "where", "wherever", "whether", "which", "whichever", "while", "whip", "whisper", "whistle", "white", "whiten", "who", "whoever", "whole", "whom", "whose", "why", "wicked", "wide", "widen", "widow", "widower", "width", "wife", "wild", "will", "win", "wind", "window", "wine", "wing", "winter", "wipe", "wire", "wisdom", "wise", "wish", "with", "within", "without", "witness", "woman", "wonder", "wood", "wooden", "wool", "woolen", "word", "work", "world", "worm", "worry", "worse", "worship", "worth", "would", "wound", "wrap", "wreck", "wrist", "write", "wrong", "yard", "year", "yellow", "yes", "yesterday", "yet", "yield", "you", "young", "youth", "zero"]

尽管最好将其保存在其他地方以便于编辑。

使用 JSON 的示例:

import json
# saving
with open('words.json', 'w') as f:
    json.dump(words, f)
# loading
words = []
with open('words.json', 'r') as f:
    words = json.load(f)

有关详细说明,请参阅文档

相关内容

  • 没有找到相关文章

最新更新