#!/usr/bin/python
# -*- coding: UTF-8 -*-
import codecs
import os,pprint
import os
import os, re
import random,readJSON
data = readJSON.read_JSON("data.json")
non = data['bosh'] # 代表文章主要废话来源
data = input("请输入关键词:")
duplication = 1
article = 0
content_page_num = int(input("请输入生成文章篇数:"))
while True:
if article == content_page_num:
break
def traverse(list1):
global duplication
pool = list(list1) * duplication
while True:
random.shuffle(pool)
for ele in pool:
yield ele
next_non = traverse(non)
for x in data:
tmp = str()
while (len(tmp) < 60):
# 分支 = random.randint(1,3)
tmp += next(next_non)
tmp = tmp.replace("x", data)
print(article)
print(tmp)
article += 1
网友评论