What is the standard practice in Python when I have a command-line application taking one argument which is
URL to a web page
or
path to a HTML file somewhere on disk
(only one)
is sufficient the code?
if "http://" in sys.argv[1]:
print "URL"
else:
print "path to file"
Depends on what the program must do. If it just prints whether it got a URL,
sys.argv[1].startswith('http://')might do. If you must actually use the URL for something useful, do