Created
April 23, 2016 11:38
-
-
Save sadysnaat/13e96c8f4a44576a5dcea137bb3b93d5 to your computer and use it in GitHub Desktop.
Use command prompt for user input
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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