completed get api for members and created misc script for adding dummydata
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import random
|
||||
import os
|
||||
|
||||
def generate_names(n):
|
||||
'''
|
||||
generates list of n random names
|
||||
returns tuple(first, last)
|
||||
'''
|
||||
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "firstnames.txt")) as f:
|
||||
fs = f.read().split('\n')
|
||||
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "lastnames.txt")) as f:
|
||||
ls = f.read().split('\n')
|
||||
|
||||
names = []
|
||||
for i in range(n):
|
||||
names.append((random.choice(fs),random.choice(ls)))
|
||||
return names
|
||||
|
||||
Reference in New Issue
Block a user