473,500 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pychecking current source file in pythonwin

Hi.

I have tried to add pychecker as an extension to pythonwin. Now I can
have pychecker check the source file that is currently open in the
editor with a single keypress. If someone is interested, here is how
to do it:

Create an empty file in your
<pythondir>\Lib\site-packages\Pythonwin\pywin directory. Give it a
name with .cfg as extension.

Into this file put the following lines (replace <pythondir> with the
path to your python installation):

[General]
Based On = Default
[Keys:Editor]
Shift+Ctrl+v = checksource
[Extensions]
def checksource(editor_window, event):
import pywin.framework.scriptutils
import os
import re

filename = pywin.framework.scriptutils.GetActiveFileName()
messages = os.popen(r"<pythondir>\Scripts\pychecker.bat %s" %
filename)
for message in messages.xreadlines():
print re.sub(r"(.*):(\d+):(.*)", r'File "\1", line \2, \3',
message.strip())
messages.close()

Start pythonwin. In the View menu select Options. Go to the Editor
tab. In the dropdown box select the name of your configuration file.
Click OK.

Now open a Python source file and press Shift+Ctrl+v. The output of
the operation can be found on the interactive screen. The script
formats the output so a double click on a pychecker message will jump
to the corresponding line in the editor.

The script should write something like "pychecker is checking your
source" into the status bar, but I haven't found out how to do that
yet. Maybe some helpful soul can help out with that.
Jul 18 '05 #1
1 2178
Mark Hammond <mh******@skippinet.com.au> wrote in message news:<bg**********@arachne.labyrinth.net.au>...
Henrik Weber wrote:
Hi.

I have tried to add pychecker as an extension to pythonwin. Now I can
have pychecker check the source file that is currently open in the
editor with a single keypress. If someone is interested, here is how
to do it:


Cool. Would you be interested in sending me a patch file? This makes
it much easier for me to integrate properly.
The script should write something like "pychecker is checking your
source" into the status bar, but I haven't found out how to do that
yet. Maybe some helpful soul can help out with that.


win32ui.SetStatusText(message, True)

Mark.


I hope it arrived.

Henrik.
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1497
by: Glenn Reed | last post by:
Hi, Someone might be able to help me with this. If I am using PythonWin (as part of the ActiveState Python distribution) (lastest release 2.2) and have two files in the editor window. ----...
3
1916
by: Tuure Laurinolli | last post by:
Some time ago I was playing with the idea of using an actual IDE to write my python code. I first played with IDLE, but noticed that it was kind of limited and for some reason it worked extremely...
14
2863
by: Jive | last post by:
I've un-installed Python 2.4, re-installed Python 2.3 and PythonWin for 2.3, but it's still broke. When I start PythonWin, sometimes it looks like it is going to be okay. But as soon as I open...
4
2595
by: Chris P. | last post by:
I've been having a problem with PythonWin that seemed to start completely spontaneously and I don't even know where to START to find the answer. The only thing I can think of that marks the point...
3
3326
by: tkpmep | last post by:
I have a Python program that collects user input using msg = "Enter the full path and name of the file to be processed: " answer = raw_input(msg) If I run it in IDLE, the question is splashed...
4
2520
by: Thomas Pfaff | last post by:
Hello all, I started using the nice Pythonwin IDE together with Python 2.3 (I have come to prefer its editor to IDLE). My problem is, that when I want to run a script in the debugger, I can...
7
4185
by: Robert | last post by:
Hello, I'm using Pythonwin and py2.3 (py2.4). I did not come clear with this: I want to use win32-fuctions like win32ui.MessageBox, listctrl.InsertItem ..... to get unicode strings on the...
17
1930
by: Dave Benjamin | last post by:
Hey folks, Why is PythonWin (win32all) still a separate download from a third party? Is it legal, technical, or what? I think it's about time it be part of the standard distribution. There...
3
1239
by: Hutch | last post by:
PythonWin has been a very good ide from early version thru 2.4. All work ok on THREE of my computers with THREE different HP printers. Now comes 2.5. Every thing seems to work the same except...
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7182
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4923
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.