Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def scaleMenu():
while True:
print("Please input the list of 7 notes in the Scale (ex: 'C Ds E ...'), a smaller list to autocomplete, or write G or g for random:")
scalet = usrinp()
if scalet in "Gg":
scale = musictheory.scale7()
else:
notenames = str.split(scalet, " ")
notes = ()
for i in range(len(notenames)):
if len(notenames[i]) != 0:
notes = notes + (musictheory.mnote.fromName(notenames[i] + "0"),)
scale = musictheory.scale7(notes)
while True:
scaleInfo(scale)
print()
print ("Accept? (Yy, Nn, Pp(preview)):")
inp = usrinp()
if inp in "Yy":
return scale
elif inp in "Nn":
break
elif inp in "Pp":
previewscale(scale)