Ikanobori Weblog

An often requested feature for bpython is windows compatibility. Because bpython uses curses to draw its interface for the command line this is a difficult feature to satisfy. There are off course curses ports for windows but curses as is is a often a mess and hard to code for (edge cases and all) and having to support multiple (or even just one) port with a slightly different interpretation is a lot of work.

However, with bpython 0.9.6 there is a solution. We don’t build official windows packages just yet, but for the adventurous I have written down a guide in this blog post on how to get bpython.gtk_ to run on a windows machine. As of 0.9.6 the GTK part of bpython is still in its early days, its baby steps.

There is currently no support for hotkeys, there is no really fancy interface. However, it does have a nice icon, it has a beautiful dropdown box for the autocompletion and it supports your theme of preference. In the feature all the minor points will be resolved and more features added as development progresses.

Anyway, lets get down to the nitty-gritty.

To install bpython on a windows machine you need an installation of python + gtk, I could copy the page I followed to do this but I will not do that. I will just link you, if you follow this page you can then come back here.

You’ll also need to install pygments from their website.

After you have installed a full version of gtk, gobject etc. the best way to proceed is to install a minor alteration of the bpython 0.9.6 version. I assume you already have setuptools installed on your windows box (for the pygments install) so you can just download the linked file and do a setup.py install.

After this all you need to do is make a shortcut to the file created by setuptools (the usual place is C:\PythonXX\Scripts\bpython-gtk.exe) somewhere where you find it handy.

Expect bugs, problems and strange stuff happening in the window (including lots of noise in the cmd-window). Report anything that seems to be a veritable bug at our issue tracker.

Good luck (and a screenshot):

bpython.gtk_ on windows.

2 COMMENTS
Vitaliy
January 21, 2010

I have this error’s… :(

Don’t work for me…

——————————–
Traceback (most recent call last):
File “c:\Python\Scripts\bpython-gtk-script.py”, line 8, in
load_entry_point(‘bpython==0.9.6-win-unofficial’, ‘console_scripts’, ‘bpytho
n-gtk’)()
File “C:\Python\lib\site-packages\pkg_resources.py”, line 318, in load_entry_p
oint
return get_distribution(dist).load_entry_point(group, name)
File “C:\Python\lib\site-packages\pkg_resources.py”, line 2221, in load_entry_
point
return ep.load()
File “C:\Python\lib\site-packages\pkg_resources.py”, line 1954, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File “c:\python\lib\site-packages\bpython-0.9.6_win_unofficial-py2.6.egg\bpyth
on\gtk_.py”, line 37, in
import gobject
ImportError: No module named gobject

Vitaliy
January 21, 2010

after install gobject…
this errors..

any ideas?
————————-
Traceback (most recent call last):
File “C:\Python\Scripts\bpython-gtk-script.py”, line 8, in
load_entry_point(‘bpython==0.9.6-win-unofficial’, ‘console_scripts’, ‘bpytho
n-gtk’)()
File “C:\Python\lib\site-packages\pkg_resources.py”, line 318, in load_entry_p
oint
return get_distribution(dist).load_entry_point(group, name)
File “C:\Python\lib\site-packages\pkg_resources.py”, line 2221, in load_entry_
point
return ep.load()
File “C:\Python\lib\site-packages\pkg_resources.py”, line 1954, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File “c:\python\lib\site-packages\bpython-0.9.6_win_unofficial-py2.6.egg\bpyth
on\gtk_.py”, line 37, in
import gobject
File “C:\Python\lib\site-packages\gtk-2.0\gobject\__init__.py”, line 30, in
from gobject.constants import *
File “C:\Python\Lib\site-packages\gtk-2.0\gobject\constants.py”, line 22, in
from _gobject import type_from_name
ImportError: DLL load failed:

Post a comment