Jump to content

Python + ScintillaNET + Pylint


Recommended Posts

Hi All,

On a system we're working on, we are allowing the operator to enter a python script.

The script is executed with LabPython, which seems to work well.

We implemented the script editing with ScintillaNET (http://scintillanet.codeplex.com/)

We also implemented pre-execution script checking (I don’t know the right term for this) with pylint (http://pypi.python.org/pypi/pylint)

Attached is an example of our implementation. I’m posting this in case anyone might find it useful.

A couple of items that could be improved

1) This implementation used system exec to run pylint, could pylint be run via LabPython? How would you retrieve the output string?

2) Disabling the scintilla .NET control (via a property node) doesn’t fit visually with other LV controls. Could the right look be achieved by manipulating the control's colors

3) Auto indentation hasn’t been implemented.

In order for this to work you'll need to install:

Python 2.7.2 (This might work with newer version, I haven't tried)

http://www.python.org/getit/releases/2.7.2/

logilab-astng-0.23.0

http://pypi.python.o...i/logilab-astng

logilab-common-0.57.0

http://www.logilab.o...b-common/0.57.0

pylint-0.25.0

http://pypi.python.org/pypi/pylint

SintillaNET 2.2

http://scintillanet.codeplex.com/

If anyone does make improvements to this, please post your updates.

Thanks

Denis

Python Trial.llb

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.