title: How to handle no input using input() function in Python?
body: <p>I tried to write a program which requests user to choose an option, however, Python always show an error message if user choose nothing and only input ENTER. Here is an example</p>
  
  <pre><code>tmp=input("Choose program type:1.C++;2.Python;3.PERL (ENTER for default 2.Python)")
  print tmp, type(tmp)   #test input
  if len(str(tmp)) == 0:
    tmp=0
  
  if tmp == 1:
    print "User choose to create a C++ program.\n"
    DFT_TYPE=".cpp"
  elif tmp ==2:
    print "User choose to create a Python program.\n"
    DFT_TYPE=".py"
  elif tmp ==3:
    print "User choose to create a PERL scripts.\n"
    DFT_TYPE=".pl"
  else:
    print "User choose incorrectly. Default Python program would be     created.\n"  
  DFT_TYPE=".py"
  </code></pre>
  
  <p>if I input ENTER only, I got error message like below</p>
  
  <pre><code>Traceback (most recent call last):   File "./wcpp.py", line 17, in &lt;module&gt;
      tmp=input()   File "&lt;string&gt;", line 0
  
      ^ SyntaxError: unexpected EOF while parsing
  </code></pre>
  
  <p>How to handle such case if user input nothing? Any further suggestion would be appreciated.</p>