Posts

Showing posts from December, 2009

How to define python source code encoding?

While using non-ASCII characters in your code, you might get this error: "SyntaxError: Non-ASCII character '\xc3' in file myprog.py on line 101, but no encoding declared;". Solution is to define encoding at the beginning of your source code. Syntax: # -*- coding: desired_encoding -*- Example: # -*- coding: iso-8859-1 -*- For details check http://www.python.org/dev/peps/pep-0263/ .

Python Console in gedit

Being an Ubuntu user gedit is my default editor for programming (sometimes I use netbeans though). Today I found a post where the author wrote about gedit plugins . I just played with it a bit and found that it has a Python Console! This is really interesting. You can also try installing the plugin: sudo apt-get install gedit-plugins Now go to: edit > preferences > plugins and select which plugins you want and enable the side pane & bottom pane from the view menue.