Reputation: 15336
The os.normalized_path
outputs .
instead of the full path.
import os
echo ".".normalized_path
Upvotes: 0
Views: 331
Reputation: 1598
@Yardanico's answer is still the right one, but this got too long to leave as a comment.
normalizePath
has no knowledge of the current working directory and operates on abstract paths, preserving whether the input is absolute or relative. what it does is:
it does not:
Upvotes: 4
Reputation:
That output is correct - it's "normalised" to the current directory, so it's ".", which is a valid path on *nix. If you want to get the full path, do it like this:
import os
echo ".".normalizedPath().absolutePath()
Upvotes: 6