Welcome to PyK



PyK is a new editor, successor of PyEdit and reStInPeace, written in Python with the help of the Qt4 toolkit.

It has nice features and is highly extensible via plugins and commands.

I'm developping it for fun, because I really like text editors.

I just finished a new video showing the basic features of PyK, so let's start to watch it here :

PyK Video

Hint : Maybe you'll have to clear your browser's cache to view it before :)


I've actually not tested other versions, so please report me bugs.


PyK is under the GNU GPL 2.0 licence.


The PyK's documentation is on this page. It's a work in progress.

It will be avaible in different formats once I finished it.


With each of these file types, it is possible to compile them, view the output in different formats. In fact, you just have to load the file and follow the Commands menu/shortcuts to view all possible actions. Actions are configurable via an XML file format.

For example, this site is just a file and I just ask PyK to produce HTML output from it via the F1 key. I can then view the output in Firefox via F2.

Here's a table of supported langages, numbers represents a factor time I have passed working on :

Langage Highlight Level (/5)
reStructuredText 3
Python 3
Asymptote 4
LaTeX 3
MetaPost 2
Lout 2
C/C++ 3


PyK supports a plugins architecture. At the time writing this page, here are the implemented plugins :

TextMate-like snippets

It was the first one I made because a really enjoy this feature. It's not perfect either because snippets can't be nested, but they can chain eachother.

You can write your own ones in each Scheme/langage_file, ie a very simple one is:

    <description>self in Python</description>

Now, each type you type '.' + Tab inside a Python file, it will be replaced by 'self'. In fact, the engine is a lot more powerfull than only replacing text. You can put placeholders inside. I let you discover it, look at some ones in Python or reStructuredText files.

But maybe the best is to show you a little snippets video ?

reStructuredText simple tables

Activated via Ctrl+Alt+T : it's a GUI so no problem;


A very experimental one (secretly activated with Alt+X, Ctrl+K). Give it an adress or even better some parts of HTML (without head and body). Press OK once done.

It uses a script I've found in Docutils's SandBox, but works badly for the moment. Any help would be appreciated.

Structure plugin

You need to view the document structure you're editing ? This one is for you ! For the moment, only reStructuredText and Python are supported.


Eval plugin

A just for fun plugin : enter a Python expression, select it, press Ctrl+Alt+E and your text is replaced by Python's internal eval function.

Example ? On a new line, enter :


Results in :


If Python's eval function failed, the application statusBar will tell you so.

Browser's plugin

This is the old reStinPeace browser for reStructuredText files only.

If you reSt file contains images, the dialog could be a little slow because it loads and copy them inside the Plugins/BrowserImages directory. But it does so only once, so next time it will be a lot faster !

I'm currently thinking of making it work with all file formats for printing via Pygments.

Blog Plugin


The Blog Plugin needs these two Python packages to work:

  • DocUtils ;
  • Pygments ;
  • a remote site where you will put all the generated HTML and CSS files;

Create a new Blog

A new blog is a directory you create inside the Plugins/Blog/BlogPlugin directory.

By default, there are two blogs KibMemo and ShadesOfPy. Let's go to the first one and edit the file 'blog.conf'. Here, I replaced the default values with these ones:

BlogHomePage : http://kib2.free.fr/Articles/
Host : ftpperso.free.fr
User : zorg21
Password : a3f8z93
RemoteDir : Articles

Now, all you have to do is to feed your blog with some posts. Let's go inside KibMemo/In directory, and you'll discover 2 factices posts, one written in reStructuredText, the other in Markdown syntax.

The major tip to remember when writting a blog post is that the first 5 lines of each post should always be written the following way

.. [tit]The posts title goes here[/tit]
.. [date]year month day hour minutes[/date]
.. [tags]Tags,Separated,By,Commas[/tags]
.. [markup]markdown[/markup]

The [markup]...[/markup] can be ommited, it is set to reStructuredText automatically.


Now, inside PyK you just have to use the PyKBlog menu and use publish to generate the HTML files and transfert to FTP to update your site.


In the Scheme directory you'll find XML files. Each one contains :

You can edit them to add/sub whatever you want.


From PyK, you can also define your own commands. They're inside the commands directory, again an XML file. Look at the given samples [there're all mine, you'll have to adapt them to your platform knowing that I'm running on an Ubuntu/Linux machine] to give you an idea about what's going on, but we'll study here a first one.

<cmd context=".tex" key="F1" args="%baseName.tex" name="pdfLaTeX" icon="" wd="">pdflatex</cmd>

Here, context means file extension, key is the keyboard shortcut to launch the given command, args are the arguments to pass to the major command. I'm using '%baseName' to indicate the file name without its extension. name and icon are just the name and the icon of the command appearing in the Commands menu. icon is not implemented yet. wd is an option to set the work directory; as it is here left blank, we're working in the application's directory. pdflatex is just the major command.

Here's a list of all placeholders with their categories

args : arguments you pass to mainscript

%home     : your home directory
%baseName : the file without it's extension ie 'foo'
%realName : the real name of the file ie 'foo.py'

wd : working directory

%appDir   : application's directory
%sciptDir : the script directory



PyK editing a LaTeX file :


You can view compile your Asymptote file to PDF and even transform them to png :


The Snippets Definitions Dialog and a new Stylesheet apllied to some controls:


The PyK Browser, a Fuzzyman 's suggestion :


The new PyK plugin reStructuredText's mode with a document browser :


PyK little setings dialog:


PyK editing an Asymptote file:


PyK editing a reStructuredText file:



Direct one

Last update on : Dec 20, 2007

A direct download is given here, but it's even better to use bazaar to keep track of PyK recent changes (see the following paragraph).

Latest Download

If you're under a Linux system, maybe you'll find it better to have a bash file for launching PyK. I'm made my own one, you only have to modify line 3 according to the directory where 'main.py' resides.

Launching it otherwise with : python main.py or python main.py myfile.

Via LaunchPad

PyK uses LaunchPad coupled with Bazaar for its revision mechanism. By using it, you're sure to be up to date. Whatever is your plateform, it only takes a few seconds to install Bazaar (really, go to the Bazaar site, there's even a Windows installer there).

Just create a directory and type

bzr branch http://bazaar.launchpad.net/~kib2/+junk/pyk

You're done.

Current state

The Blog plugin has been build and I've made a big update in Plugins.

I'm now sure there's some memory problems, that should be difficult to debug because I've got no error from the GUI.


  • 1.0.16 : Corrected a Windows bug with Plugins paths handling. Now PyK runs well under this OS.

  • 1.0.15 : The Structures plugin was causing big memory leaks, in fact some signal was connected two times causing an infinite loop, sorry for this : it has now been fixed.

    Here's a screenshot of the Blog plugin in action:

  • 1.0.14 :

    This time, a big clean in Plugins : each one has now its own directory and is not a Singleton anymore.

    I also removed the Black stylesheets on some controls because there's a known Qt4 bug on the sliding bar wich prevents you from using it with the left mouse button.

    The big news is the blogPlugin : a new menu appears on the right-side of the About one. For the moment only (as it's in early beta stage), it uses also uses 2 tabs inside the Projects Pane :

    • the Projects Tab to lists your blogs (you can have as many as you want) where you have to doucle click to set your working Blog [The first one is used by default];
    • the All Posts Tab showing all the posts for a given Blog;

    There are two example blogs given...Don't worry, I'm thinking of writting up a doc for it soon.

  • 1.0.13 :

    Big clean in the code;

    The Structure plugin handles Python scripts quite well, reconizing the differences between functions(f), classes(c) and classes defs(d).


    Added all reStructuredText symbols to Structure plugin;

    Added a Color button so you can now press it to insert your choosen color in any editor, at any cursor place.

    I also spend some time with the magnificient InkScape software building PyK a new icon.

  • 1.0.12 : The Structure plugin now handles reStructuredText sections according to their level. Here's an image :


Known bugs

  • The latest version does not seems to like Windows. The cause is the Plugins subdirectories...I will try to do my best but I've no Windows machine yet.

Ideas for the future

Here I'll put some ideas I've got to implement in the next releases :


For bugs and suggestions : kib2 at free.fr. Maybe you can give some comments on my Blog too. Thanks in advance.