Skip to content

Instantly share code, notes, and snippets.

@sadysnaat
Created April 23, 2016 11:38
Show Gist options
  • Save sadysnaat/13e96c8f4a44576a5dcea137bb3b93d5 to your computer and use it in GitHub Desktop.
Save sadysnaat/13e96c8f4a44576a5dcea137bb3b93d5 to your computer and use it in GitHub Desktop.
Use command prompt for user input
import os.path
# https://docs.python.org/2/library/functions.html#raw_input
report = raw_input("Please enter report location: ").strip()
# You can't always begin your programming flow with the
# input user has provided. It is better to check user input.
# In this case here is one useful check
if not os.path.isfile(report):
# Alert user for file doesn't exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment