2007-02-20

user input in python


#!/usr/bin/env python

import sys

min = 1

if len(sys.argv) - 1 < 1:
while 1:
num = raw_input("Please enter something: ")
if len(num) > 0:
break
else:
num = sys.argv[1]
print "You entered:", num

No comments: