Sunday, December 1, 2019

PyScripter 3.6.2 released

PyScripter 3.6.2 is now available at Sourceforge.   Here is the list of changes:

  • New features:
    • Improved compatibility with venv virtual environments
    • Restore code folding state when you start PyScripter (#973)
    • Syntax for adding and removing parameters (#971). $[proc=?Question] adds parameter proc and $[proc=] removes it
    • Improved DPI scaling
    • Highlighters and styles are now installed under ProgramData to better support multiple users on the same computer
    • Two new styles added (Calypso and Stellar)
  • Issues addressed:

Friday, September 27, 2019

Improvements in Code Completion

The next version will contain some fixes and improvements in code completion as well as in find definitions (Ctrl+Click) and references of identifiers.  For example if you have defined a class called MyClass then

MyClass().

will offer completion suggestions.  Or if my function returns an instance of a class you will get completion on the return type of the function. e.g.

myfunction().

You will also get completion suggestions on lists dictionaries and sets, i.e.

[].
{}.

And by the way string competion already works:

"abc".

Sunday, September 22, 2019

Reinstalling Windows Apps

This post is not related to PyScripter.  However some of you may find it useful.

It has happened to me before, but more recently when I installed the latest Windows 10 update many apps including Microsoft Store failed to start.  Also my Logitech keyboard started misbehaving (for instance pressing the left arrow produced the letter a).  After searching for a solution for a while I came across the following Powershell command which resolved all problems:


Get-AppXPackage | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

You need to run it as administrator.  It solved all my problems. Pure magic!

Saturday, July 20, 2019

PyScripter 3.6.1 released

PyScripter 3.6.1 is now available at Sourceforge.  The main new features are support for Python 3.8 (currently in beta) and better compatibility with Anaconda distributions.   Here is the full list of changes:

  • New features:
    • Python 3.8 support. Dropped support for Python 3.0 and 3.1.
    • Compatibility with conda distributions
    • JSON and YAML file templates added
    • Three new styles added (Windows10BlackPearl, Windows10BlueWhale, Windows10ClearDay)
    • Translation improvements
    • "Always Use Sockets" IDE option is True by default (#938)
  • Issues addressed:

Wednesday, July 17, 2019

PyScripter and Anaconda

In the past I have used successfully  PyScripter with Miniconda distributions, but since there have been a few issues reported regarding the compatibility of PyScripter with Anaconda distributions, I decided to investigate.   I downloaded the latest version of the Anaconda distribution (Python 3.7.3) and installed it registering it as the default Python 3.7 distibution.

Installation issues

After the installation the Anaconda Navigator and pip did not work.  This appears to be a long standing issue that apparently has not been fixed.  The solution that worked for me is the last answer in this Stack overflow question (copy the two files from CONDA_PATH\Library\bin to CONDA_PATH\DLLs).  Note, that if you create virtual environments and want to use pip inside them, you need to repeat the above steps for the created environements.

Another annoyance is that the Python help file is missing.  To correct you can copy the Doc folder from a corresponding python installation from python.org to the Anaconda folder.

PyScripter issues with Anaconda

PyScripter failed to work out of the box with the installed distribution (crashed without any error message).  I successfully managed to used PyScripter with Anaconda, by running it from inside an Anaconda prompt.   I then realized that Anaconda requires that certain folders are in the Windows path.  The installation program gives you the option of modifying the path, but it recommends to not do so.  So I suspect that most users including me do not modify the Windows path and I have made some changes to PyScripter to adjust the Windows path on the fly when using conda distributions.

To make a long story short, the forthcoming version 3.6.1 provides a much smoother out-of-the-box integration with Anaconda and conda created virtual environments.

Friday, January 11, 2019

Improved consistent syntax highlighting

PyScripter 3.6 provides improved consistent highlighting of the support languages.  You can select your favourite highlighting scheme using Tools, Options, Editor Options, Color Theme.  Here is a sample using the Dark_waher theme:

Python:

HTML:

JavaScript:
JSON:


Note that you can easily adjust the background color of a theme, keeping the rest of the colors the same. (Adjust darkness to your taste).

SSH Engines using Putty

In addition to OpenSSH, PyScripter 3.6 support the use of PuTTY for connecting to remote engines using SSH.  PuTTY is an easy to use and popular SSH client.   After you download PuTTY you can use to connect to remote machines either:
  • using user name and password or
  • by setting up a public/private key combination and setting up a password-free login using the pagent utility
PyScripter supports both modes of connection, but clearly the password-free login is faster and easier once you make the effort to set it up.  This video, among others, explains how to do this.

Here is a sample SSH engine configuration using putty:


You need to provide:
  • the user name
  • the host name (ip address)
  • the paths to the scp and plink commands of putty.  (plink is putty's ssh command)
  • the server name used to identify this SSH engine
  • ssh and scp options (if needed)
  • the command that will be used to run python in the server
  • if you have not setup a password-free connection then check the "Password Needed" option.
Then use the Run, Python Engine, SSH menu option to connect to a remote machine.   If a password is needed PyScripter will prompt you for the password.  Also if you connect the server (host machine) for the first time,  PyScripter will warn you about an "unknown server" and ask you whether you want to proceed.   Everything is hanlded automatically.  And there you are:


You can now run and debug programs on the remote server.  You can also open and edit remote files in the editor and save them back to the server as if they were local.

System commands in the interpreter

PyScripter 3.6 allows you to issue system commands in the interpreter.  System commands start with an exclamation mark (!).  For example:


One gotcha that you need to be aware is that you changing the current directory will not have any effect, since system commands are executed in a separate process.  You will need to use  os.chdir for the change to take effect.

A nice twist about this feature, is that if you use an SSH Engine you can issue system commands to the remote server:



PyScripter v3.6 released

Happy New Year!

PyScripter 3.6.0 is now available at Sourceforge.  There is a range of important new features and bug fixes in this release:

New features:
  • Much faster Remote Engine using asynchronous Windows named pipes if pywin32 is available.
  • IDE option to force the use of sockets for connection to the Python server now defaults to False.
  • Enhancements to the SSH Engine - now compatible with PuTTY.
  • Execute system commands in the interpreter with !. Supports parameter substitution.
  • Clickable status panels with Python version and engine type.
  • Text drag & drop between PyScripter and other applications #554
  • Triple-click selects line and Quadraple-click selects all
  • Double-click drag selects whole words - triple-click drag selects whole lines
  • Consistent syntax color themes accross supported languages #855
  • New IDE option "Trim trailing spaces when saving files" #667
  • New IDE Option 'Step into open files only'. Defaults to False. #510 
Issues addressed: