READMEWhen moving from Eclipse and PyDev to vscode I always missed the functionality to automatically update a module variable to the date and time when saving the file to disk. There were other functionalities I missed too. From this was born the idea of the extension "python-coding-tools". It should contain a compilation of python coding tools which are missing but are helpful in the everyday coders life. It is specifically designed to complement the other python extensions out there.
It won't do anything to files which have not the languageId FeaturesUpdate python module variableThis extension provides a command to 'Update a python module variable'. The name of the python module variable can be configured. The date and time format used when updating the variable's value can be configured in moment.js (sadly not python's) notation. The command can be automatically executed on saving a python file active in the foreground. The automatic command execution on saving a python file can also be disabled in the configuration. UsageFor those, who never have used this feature with Eclipse and PyDev, here is a short how to description with the default settings. First you have to put a variable to the module (
On saving the file, the value gets filled by the current date and time.
Which then results in the following output when executing the Python script:
The variable works also in Python2. But as Python2 just has 10.5 months left in the tank, I strongly encourage you to migrate to Python3. The variable is also accessible when importing a module.
When executed the result looks like this:
Extension SettingsThis extension contributes the following settings: Update module variable
Known Issues
Release Notesx.x.x - UNRELEASED1.0.4 - 2022-08-03
1.0.3 - 2019-06-08
1.0.2 - 2018-10-141.0.1 - 2017-07-16
1.0.0 - 2017-07-16
|