Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #106393

Re: PyQt4

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Michael Torrie <torriem@gmail.com>
Newsgroups comp.lang.python
Subject Re: PyQt4
Date Sun, 3 Apr 2016 13:14:45 -0600
Lines 24
Message-ID <mailman.407.1459710890.28225.python-list@python.org> (permalink)
References <b9ad8b64-b6a9-49df-8085-2d7afd2a406f@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de 6M4wuyvlstRAkforeIUQvAOGJxjzAfjl+oIjwAReHxmA==
Return-Path <torriem+gmail@torriefamily.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'ideally': 0.04; 'binary': 0.05; 'importerror:': 0.05; 'installed.': 0.05; 'python': 0.10; 'suggest': 0.15; '12:57': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'try:': 0.18; 'machine': 0.21; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'install': 0.25; 'header:User-Agent:1': 0.26; 'example': 0.26; 'installed': 0.26; 'linux': 0.26; 'not.': 0.27; 'specify': 0.27; 'installed,': 0.29; 'code': 0.30; 'machine.': 0.33; 'message-id:@gmail.com': 0.34; 'except': 0.34; 'skip:d 20': 0.34; 'attempt': 0.35; 'something': 0.35; 'depends': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'hi,': 0.38; 'end': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'confirm': 0.62; 'charset:windows-1252': 0.62; 'managers': 0.63; 'rpm': 0.91; 'technique': 0.93; 'ali': 0.95
X-Virus-Scanned amavisd-new at torriefamily.org
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
In-Reply-To <b9ad8b64-b6a9-49df-8085-2d7afd2a406f@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:106393

Show key headers only | View raw


On 04/03/2016 12:57 PM, Muhammad Ali wrote:
> 
> Hi,
> 
> How can we confirm that either  PyQt4 is already installed on LInux machine or not?
> 
> Please suggest commands to confirm the already existence of  PyQt4 in the machine.

Ideally you make a distribution-specific package of the binary in a .deb
on Debian or an RPM on other distros, and specify that it depends on the
package that provides PyQt4.  That way when it's installed, modern
package managers will automatically install the dependencies.

Alternatively you can use try and except in your python code to attempt
to import something from PyQt4 and see if it fails or not.  This
technique is also used to make your code work either PyQt4 or PySide,
depending on which the user has installed.

try:
    from PySide import QtGui
except ImportError:
    from PyQt4 import QtGui

If neither are installed, this little example will end with an ImportError.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

PyQt4 Muhammad Ali <muhammadaliaskari@gmail.com> - 2016-04-03 11:57 -0700
  Re: PyQt4 Michael Torrie <torriem@gmail.com> - 2016-04-03 13:14 -0600
    Re: PyQt4 Muhammad Ali <muhammadaliaskari@gmail.com> - 2016-04-03 12:36 -0700
      Re: PyQt4 Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be> - 2016-04-03 22:32 +0200

csiph-web