Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Creating methods depending on packages that have been installed

Reply
Thread Tools

Creating methods depending on packages that have been installed

 
 
C Gillespie
Guest
Posts: n/a
 
      05-24-2005
Dear All,

What is the best way of creating methods depending on the packages that have
been installed.

A silly example is

try:
import somepack
class hello:
def __init__(self):
print 'hi'
def some(self):
print 'some'
except:
class hello:
def __init__(self):
print 'hi'

This is obviously not what I want - since it looks ugly and I wish to test
for lots packages.

Any ideas?

Thanks

Colin



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Installed python 2.5 over 2.4 and lost installed packages james@reggieband.com Python 3 04-28-2008 09:26 PM
Adding code/Extending methods after they have been written? Marc Heiler Ruby 1 01-26-2008 09:26 PM
Do the javax.imageio packages replace packages in com.sun.image? Paul Smith Java 0 11-18-2003 02:58 PM



Advertisments