MCPcopy Create free account
hub / github.com/ActiveState/code / which_CD

Function which_CD

recipes/Python/578207_Console_CD_Player/recipe-578207.py:16–28  ·  view source on GitHub ↗
(maximum)

Source from the content-addressed store, hash-verified

14 face.quit()
15
16def which_CD(maximum):
17 print 'You have %s cdrom drives.' % maximum
18 while True:
19 try:
20 num = int(raw_input('What cdrom drive do you want to use? '))
21 except ValueError:
22 print 'Please try typing a number.'
23 except:
24 return -1
25 else:
26 if 0 < num <= maximum:
27 return num - 1
28 print 'The number is out of range.'
29
30def cmd(disc):
31 disc.init()

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected