Sunday, December 31, 2017

Adjust darkness to your taste

Since version 3.0, PyScripter ships with many great looking editor themes (editor syntax coloring), both dark and light.  You can also select dark or light styles for the application user interface through the View, Select style menu command.
To change editor themes you need to invoke the Editor Options (Tools, Options, Editor Options or via the Editor context menu), go to the Color Theme tab, select the theme you like and press the "Apply Theme” button.  Below you see PyScripter with the Windows 10 Dark style and the Retta editor theme.
image
Sometimes you may find that although you like the color scheme of a theme, its background is too dark or too light for your taste.  It is actually very easy to adjust the darkness of a theme.  Just invoke the Editor Options and activate the Syntax Colors tab and find the “Space” element (see below).
image
The “Space” syntax element is a special one.  Its background color is used to paint all empty parts of the editor.  It is also the default background of all other elements (i.e. it is used as the background for elements with background set to clNone).  Its foreground color is used to paint space, tab and end-of-line marks when “Show special characters” is selected.  So, all you have to do to “lighten” a theme is to change the background color of the “Space” element.  In the following picture the background color of the Space element was changed to #282828.
image

Code folding in PyScripter

A much requested new feature in PyScripter 3.1 is support for code folding.  Before I explain how to use it let me make it clear that if you believe that code folding is an unwanted gimmick you can disable it through the Tools, Options, IDE Options menu selection.  Just uncheck “Code folding enabled by default” under Editor options.

image

You can fold sections of the code by clicking the + (plus) signs in the gutter and can unfold folded sections by clicking the – (minus) signs or by clicking at the boxes with the three dots at the end of the lines (see picture above).

Code folding commands

The code folding commands can be fount in the context menu of the editor (i.e. you can see them by right-clicking on the editor).   There are editor shortcuts defined for many of these functions.  The default editor shortcuts are listed below.

Command Shortcut Description
Fold All Shft+Ctrl+- Fold all ranges
Unfold All Shft+Ctrl+/ Unfold all ranges
Fold Nearest Ctrl+/ Fold nearest range
Unfold Nearest Shft+Ctrl+/ Unfold nearest range
Fold Regions   Fold all regions
Unfold Regions   Unfold all regions
Fold Level 1 Ctrl+K Ctrl+1 Fold top level ranges (level 1)
Unfold Level 1 Shft+Ctrl+K Shft+Ctrl+1 Unfold top level ranges (level 1)
Fold Level 2 Ctrl+K Ctrl+2 Fold level 2 ranges
Unfold Level 2 Shft+Ctrl+K Shft+Ctrl+2 Unfold level 2 ranges
Fold Level 3 Ctrl+K Ctrl+3 Fold level 3 ranges
Unfold Level 3 Shft+Ctrl+K Shft+Ctrl+3 Unfold level 3 ranges
Fold Functions   Fold all functions (IDE command)
Unfold Functions   Unfold all functions (IDE command)
Fold Classes   Fold all classes (IDE command)
Unfold Classes   Unfold all classes (IDE command)

Note:  Regions are areas of the file that  start with #region and  end with

#endregion. e.g.

#region Description

...

#endregion

PyScripter version 3.1.0 released

Happy New Year!

I am pleased to announce the release of PyScripter 3.1.0.  You can download it from SourceForge. The major new feature in this release is the support of code folding.  Here is the list of new features and fixes:
  • New features:
    • Code folding
    • Indentation lines
    • New IDE option "Compact line numbers"
    • pip tool added
    • Internal Interpreter is hidden by default
    • Kabyle language added
  • Issues addressed:

Tuesday, October 24, 2017

Installing python packages the easy way and checking your code with pylint

The external tools is a powerful feature of PyScripter that is relatively unknown.   Below I describe how you can use it to install python packages easily using pip.

Start PyScripter and select Tools, Configure tools..  In the dialog box select Add.  Fill the following info:

Name : pip
Description: Install python packages
Application: $[PythonExe-Short]
Parameters: $[PythonDir-Short]Lib\site-packages\pip install $[Package?Package Name]

Note:  You can provide the custom parameters in the Application and Parameters fields easily using the Shift-Ctrl-P and Shift-Ctrl-M shortcuts.  For example to get $[PythonExe-Short] press Shift-Ctrl-P, select PythonExe and then press Shift-Ctrl-M and select Short.   See the help file topics External Tools and Parameters for more information.  This is a picture of the result.



Press OK twice to save the tool.   Now it is ready to be used.

Important:  If you are using an "All users" python installation you will need administration rights to install python packages.   Exit PyScripter and run again as administrator (In the start menu right click on PyScirpter and select the "Run as Administrator" option.

Select Tools, Tools tools pip to run the external tool.  You will prompted for a package name.  Type lint and press OK.

You will see the output of the installation process in the Output window.  If the installation is successful pylint will have been installed.

Pylint is a powerful source code checker.  To use it  place the cursor on a python module and select Tools, Tools, pylint.   The issues the pylint finds will be placed in the Messages window as in the example below.  You can click on any message to jump to the corresponding position in the code.



The pip tool will be included in the next version of PyScripter.


Monday, October 23, 2017

PyScripter version 3.0.2 is out

This is a hotfix release.  32-bit Python versions starting with 3.5 changed the way they are registered in the Windows Registry and PyScripter would not automatically find them.  This should now be fixed.

Tuesday, October 17, 2017

PyScripter 3.0.0 released

At long last a new Pyscripter release. You can download it from (Sourceforge).  Here are the new features:
  • Python 3.5, 3.6 and 3.7 support
  • New Style Engine (VCL Styles) with high quality choices
  • Visual Style Preview and selection (View, Select Style)
  • Visual Source highlighter theme selection (Editor Options, Select theme)
  • German Translation added 
See below a screenshot with the Windows 10 Dark style and the DarkHighlight highlighter theme.