第一步:首先生成一个500位的数组 驼峰类型的元素 用作文件名 eg:AsdfdfGsd
import random
import string
first = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
second = "abcdefghijklmnopqrstuvwxyz"
number = "345"
index = 0
array = []
for i in range(500):
final=(random.choice(first))
index = random.randint(3, 5)
for i in range(index):
final+=(random.choice(second))
final += (random.choice(first))
for i in range(index):
final+=(random.choice(second))
array.append(final)
print (array)
第二步:
用上边生成的数组来创建对应的.h和.m文件
# -*- coding: utf-8 -*-
import random
import os
import string
#创建.h文件
def text_createH(fileNmae,msg,msg1,propertyNumber,methodArray,msg3):
full_path = '/Users/zhoujinglin/Desktop/python-H-M/' + fileNmae + '.h'
file = open(full_