Closed sfolgar closed 9 years ago
thanks a lot for adding this! Can you add a check whether the file exists? ;) good to merge then.
Done, although I'm sure there should be a more idiomatic way of checking this in python.
A more pythonic way would be something like this:
try:
with open(file) as f :
text = f.readlines()
except EnvironmentError: # IOError, OSError, ...
print("Some Error")
# you could also catch the individual exceptions here, instead of the generalized one above
see https://docs.python.org/2/tutorial/inputoutput.html#methods-of-file-objects
But it is also fine as you did it
By default,
waypoint_nav
has a hard-coded reference tosampleways.txt
. This quick fix allows it to receive the path of a waypoint file as its first command-line argument.