just my 2 cents to help you
i added the fact that all is saved to a file
and that you can hit ctrl+c cleanly to abort operations (took less 30 secs to complete)
Code:
#Phone Nums Generator
import sys;
if len(sys.argv) != 2:
print "Usage: ./python phonenums.py [--mobile] [--home]";
sys.exit(1);
try:
if sys.argv[1]=="--mobile":
FILE = open('mobilenums.list','w');
print 'Wait when generating Mobile Phone List or Hit Ctrl+C in order to Abort';
for i in range(0000000,9999999):
FILE.write('070' + str(i)+'\n');
print 'Mobile Phone Nums Written in mobilenums.list';
elif sys.argv[1] == '--home':
FILE = open('homenums.list','w');
print 'Wait when generating Home Phone List or Hit Ctrl+C in order to Abort';
for i in range(0000000,9999999):
FILE.write('090' + str(i)+'\n');
print 'Home Phone Nums Written in homenums.list';
else:
print 'Error !! UnHandled Option';sys.exit(1);
except KeyboardInterrupt:
print 'Aborted by User';
it's quite crude coding and could be better , but after all you just ask for hints and we have both Mr Green and Me provided more than that.