On Mon Dec 22 2014 at 1:35:44 PM Dave Angel <da...@davea.name> wrote: > > No idea what part main.py plays to your code. If it's imported, then > you could use main.__file__ to get the full pathname to it. Then use > os.path.dirname() to get the directory. Then use os.path.join() to > combine that with "bumpr.log". > > More likely, this is your script. So if you're trying to get the > filename from the script, you just use > __file__ > > And if that doesn't show up as an absolute path, use os.path.abspath. i > couldn't test that part, since I don't use Windows, and can't play with > the Windows Task Scheduler. >
Thanks guys, it worked like a charm. str(os.path.abspath(__file__)).replace('main.py', '') So I get the full-path of my main dir where main.py is and all the other modules/packages too, no matter if I'm on OSX/Win/Linux. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor