Author terry.reedy
Recipients serhiy.storchaka, terry.reedy
Date 2016-07-05.22:07:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1467756467.34.0.806864708733.issue27452@psf.upfronthosting.co.za>
In-reply-to
Content
How can you get a relative path in 3.6 (or other current Python)? To test, I wrote file.py containing "print(__file__)".  Executing from IDLE, with "python path/to/file.py", "path/to/file.py", "file.py" in the path/to directory, and "python -m to.file" (where path is on sys.path) all resulted in the absolute path.  After adding "input()" to suspend execution, double clicking in Explorer gives the same result.  Have I forgotten something? Do any of these result is something different on Linux? (or Mac?, for that matter)

The only reason to execute rather than import config.py is to run the test at the end of the file after editing the file.  In the absence of a thorough automated test, I occasionally do so.

The approximately 500 lines of output is too much to read in detail (although one might check one specific part), but that it runs and produces the same number of lines before and after a change is reassuring. I should add a line counter and checksum to the dump function.

As for removing RemoveFile: idlelib in 3.6 is, with a few exceptions, a private API.
History
Date User Action Args
2016-07-05 22:07:47terry.reedysetrecipients: + terry.reedy, serhiy.storchaka
2016-07-05 22:07:47terry.reedysetmessageid: <1467756467.34.0.806864708733.issue27452@psf.upfronthosting.co.za>
2016-07-05 22:07:47terry.reedylinkissue27452 messages
2016-07-05 22:07:46terry.reedycreate