PyGreSQL, DLL search path, IDLE versus python command line

2006-08-01 Thread h112211
Hi all,

I'm using the Windows version of Python 2.4.3 and everything worked
okay until I installed PyGreSQL. Well, in fact the installation went
fine, but when I try to run my script from IDLE I get:

Traceback (most recent call last):
  File "\main.py", line 3, in -toplevel-
import pgdb
  File "C:\Program Files\Python24\Lib\site-packages\pgdb.py", line 69,
in -toplevel-
from _pg import *
ImportError: DLL load failed: The specified module could not be found.

A quick surfing session suggested that this happens because libpq.dll
cannot be found.

However, if I start the Python command line (from the installer-created
start menu shortcut) I can "import pgdb" without any errors whatsoever.

And yes, the dir containing libpq.dll is in my windows path.

Anyone know why the the command line finds everything but IDLE doesn't?

-- 
http://mail.python.org/mailman/listinfo/python-list


DLL search path, IDLE versus command line

2006-08-01 Thread h112211
Hi,

Does anyone have any clues why I can import a module (pgdb) from the
python command line, but trying to run a script doing it from IDLE I
get "ImportError: DLL load failed: The specified module could not be
found."?

How does the search path differ between IDLE and the Python command
line?

I'm using Python 2.4.3 on Windows.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which Python API for PostgreSQL?

2006-08-05 Thread h112211
Hi,

> I also recommend psycopg.

Any specific reasons to go for psycopg instead of PyGreSQL?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Make Object Oriented?

2006-08-10 Thread h112211
Michael Yanowitz wrote:
> Hello:
>
>Are there any tools to convert non-object-oriented code
> into object-oriented code?

Nope, but you can have the next best thing: rewrite it from scratch
yourself.

I did that to a smallish (about 50k lines) C program once, and the
resulting 70k lines or so C++ program was superior to the old version
in many ways. However, maybe the best result was that after the rewrite
I knew the problem domain and the implementation inside out, much
better than I would've by reading and running the old C code, which was
written by someone else.

Of course, today I'd do it in 15k lines of Python ;)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Rendering Vector Graphics

2006-08-11 Thread h112211
> I need to render high-quality vector graphics with Python. I was
> thinking of something like 'cairo', though I need to run under win32
> and can't find a pycairo package for it. Suggestions?

I've had good experiences doing simple 3d vector stuff with Pygame.
It's wraps SDL so it has pretty nice capabilities.

-- 
http://mail.python.org/mailman/listinfo/python-list


PIL problem: IOError: cannot identify image file

2006-08-20 Thread h112211
Hi,

I installed the newest available PIL (1.1.5 for Python 2.4) from their
site, but cannot seem to open any files. The following

from PIL import Image

i = Image.open(file('c:\\image2.png'))

results in

  File "C:\Program Files\Python24\lib\site-packages\PIL\Image.py", line
1745, in open
raise IOError("cannot identify image file")
IOError: cannot identify image file

for any graphics file I've tried. Anyone know what's wrong?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PIL problem: IOError: cannot identify image file

2006-08-20 Thread h112211
Doh! Apparently Image.open() wants a path, not a file. So

i = Image.open('c:\\image2.png')

works fine.

-- 
http://mail.python.org/mailman/listinfo/python-list