A powerful and possibly underused feature or PyScripter is the Externa Tools. A collection of such tools is included with the installation, but you can create your own.
Virtual python environments are isolated workspaces, that allow you to install packages and test code, without messing up the main python installation. After using them for a specific purpose you can just delete them. Python ships with a module called venv, that allows you to easily create such virtual environments.
Instead of creating such environments from the command prompt you can create an external tool to do that. You can can create new external tools using Tools, Configure Tools, Add. You can then fill the information as in the image below.
You can run the created tool by selecting it from the Tools, Tools menu. It will prompt you for a folder in which the virtual environment will be created and then will create the environment. To use the created environment, you then go to Run, Python Versions, Setup Python Versions..., add a new unregistered python version at the new virtual environment folder and activate it.
If you are using Conda python distributions you can create an external tool to create conda virtual environments instead. Note though, that conda virtual environments are much more heavyweight than the venv ones.
The next release of PyScripter will add such an external tool to new installations and you can easily add it to existing installations.
No comments:
Post a Comment