How can I create a file in python one directory up, without using the full path?
I would like a way that worked both for windows and linux.
Thanks.
People don't seem to realize this, but Python is happy to accept forward slash even on Windows. This works fine on all platforms:
fobj = open("../filename", "w")