473,804 Members | 3,182 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PyQt + PygreSQL

Hello,

I am using the following with python:

The PyQt python bindings:

http://www.riverbankcomputing.co.uk/pyqt/

based on the Qt GUI Application Framework:

http://www.trolletch.com/

as well as the PyGreSQL python bindings:

http://www.pygresql.org/

based on the PostgreSQL database server:

http://www.postgresql.org/

I have the following question. When I instantiate QDataTable with C++
I must ensure that a database connection is open, and then have no
problems, otherwise I will get popup widgets with errors.

How can I properly set the default database connection and have
QDataTable find it using the combination of Python + PyQt + PyGreSQL?

Thanks,

Neil
Jul 18 '05 #1
2 2784

I don't know how to set it up using pygresql, but you can do it using
qtsql module. Just make sure that qt was compiled with the postgresql
support.

If you need to use pygresql for some reason, you could always try to have
multiple connections to the database from you code (one through qtsql
module, another through qtsql). That will probably get very ugly very
quickly.

Greg
On 10 Aug 2004 13:43:05 -0700, Neil Zanella <nz******@cs.mu n.ca> wrote:

I have the following question. When I instantiate QDataTable with C++
I must ensure that a database connection is open, and then have no
problems, otherwise I will get popup widgets with errors.

How can I properly set the default database connection and have
QDataTable find it using the combination of Python + PyQt + PyGreSQL?

Thanks,

Neil


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 18 '05 #2
Grzegorz Dostatni <do*******@yaho o.com> wrote in message news:<op******* *******@news.sr v.ualberta.ca>. ..
I don't know how to set it up using pygresql, but you can do it using
qtsql module. Just make sure that qt was compiled with the postgresql
support.
Thanks, I should have used the Python equivalent of QSqlDatabase::a ddDatabase()
to connect to PostgreSQL instead of using PyGreSQL. That way QDataTable can
find and use the database connection handle it knows about. After all, PyQt
knows nothing about PyGreSQL: as you just pointed out the two packages are
completely unrelated and independent of each other.
If you need to use pygresql for some reason, you could always try to have
multiple connections to the database from you code (one through qtsql
module, another through qtsql).


Exactly, but actually now that you pointed this out to me I don't think
I will need PyGreSQL since I'm already using the Qt database module.

Thanks,

Neil
Jul 18 '05 #3

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

Similar topics

35
7775
by: Vamsi Mudrageda | last post by:
I am kind of new to Python, and after trying and using wxPython, I found it kind of lacking in easy-to-read documentation, speed at loading, and GUI response-time. So I am looking for an another GUI toolkit that is cross-platform for Python, and am leaning toward PyQt (PyGTK is kind of dull looking in comparison). Unfortunately, although TrollTech says Qt is cross-platform, its license strategy has me a bit confused. So here is to...
8
4855
by: simo | last post by:
OK, so I'm at the stage where I want to make a choice between wxPython and PyQt. Currently I'm using wxPython mainly due to the fact that it has GPL Linux and Windows versions. I prefer Qt to wxWindows, but am confused with all the Windows licensing issues. For the moment this is just for my own tinkering and utility apps, but
1
1937
by: Radu Stanciu | last post by:
Hi, I want to use the PygreSQL modules on a Windows machine (more exactly a WinXP one). I've downloaded the latest version (3.4 so far) and I am required to build the pgmodule C library. Is there a way to avoid this? I need to install this on many user systems and it would be very hard to do. Is there a compiled package available for this? Or an easier way to install this package?
4
5814
by: Chuck Amadi | last post by:
Hi all Anyone know a good Pygresql Tutorial for Interfacing between Python & Postgresql . Cheers Chuck
10
2214
by: svenn.are | last post by:
Hi, I wanted to run a program that is written in PyQt on my mac, and went over to Riverbank to get PyQ 3.13 and SIP 4.1.1 sources. I followed the installation guide except for the compiling python as Macosx already has python. I had no problem with compiling SIP and also no problem with compiling PyQt nor did I have any error message during make install.
1
2532
by: Jan Danielsson | last post by:
Hello all, I'm trying to use pygresql to insert binary data (type: bytea) into a column (using postgresql, obviously). To make a long story short: I can't get it to work. Not even by cutting and pasting the very few examples I have found on the 'net. Does _anyone_ have a working example? A simple insertion, and a simple select is all I'm looking for.
2
4379
by: Martin P. Hellwig | last post by:
Hi all, I'm playing a bit with PostgreSQL, in which I've set me the target to create a python script which with user input creates a new user role and a database with that owner (connecting to template1 since I know that at least that db exists). Ok so I installed PostGreSQL and pygresql since it looked like that this is endorsed by PG, I had some trouble with the DB-API2 (complains about there is already a connection to template1,...
2
2595
by: goodepic | last post by:
I successfully installed postgresql and pygresql from source on my MacBook 2ghz Intel core duo running os x 10.4.8. However, pygresql installed under the defualt python 2.3 installation, while I've been upgrading and working in 2.5, and have invested too much time to go back to 2.3. I definitely don't know where every file is, but I know that the site-packages folder where I need pgdb to be is...
0
865
by: D'Arcy J.M. Cain | last post by:
On Mon, 19 May 2008 18:00:30 +0200 <ervin.ramonllari@hotmail.comwrote: I assume that you got the installer from http://www.PyGreSQL.org/. If so, please join the PyGreSQL list (see above URL) and explain the problem there. It's my module but I don't create the Windows package. Others on that list can probably help you better or create a fixed installer if that is the problem.
0
9587
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10085
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7623
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5662
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3827
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.