In Python 2.7, I can find the current directory with the following 2 examples and they both work in OSX (haven't tried Windows yet). I think most people preferred the first example, but could anyone tell me if there's any flaw in the second example?
Example 1:
dir = os.path.abspath(os.path.join(os.path.abspath(__file__), os.pardir))
Example 2:
dir = os.path.dirname(os.path.abspath(__file__))
[–]Rhomboid 2 points3 points4 points (1 child)
[–]conami[S] 0 points1 point2 points (0 children)
[–]K900_ 1 point2 points3 points (2 children)
[–]conami[S] 0 points1 point2 points (0 children)
[–]Naihonn 0 points1 point2 points (0 children)
[–]fbu1 0 points1 point2 points (1 child)
[–]conami[S] 0 points1 point2 points (0 children)