This function takes a filename and returns the absolute path.
The reason this was written is that os.path.abspath() can convert a relative path, os.path.expandvars() can expand a shell variable, and os.path.expanduser() understands ~, but none of these does all three. This function piggybacks the three of these to guaruntee any path will be returned absolutely.
Parameters: |
|
---|---|
Return type: |
Function to check a file and raise an IOError if it is not “safe.” “Safe” meaning that the file exists and it is readable.
Parameters: | filename (str) – The file you wish to check the safety of. |
---|---|
Return type: | None |
Exception: | IOError : Raised when a file is not safe |
range_check() will verify that that given range has a low lower than the high. If both numbers are integers, it will return a list of the expanded range unless expand is False, in which it will just return the high and low. If low or high is not an integers, it will return the low and high values as floats.
Parameters: |
|
---|---|
Return type: | See the explanation of expand. |
Exception: |
|