Creating methods depending on packages that have been installed

Discussion in 'Python' started by C Gillespie, May 24, 2005.

  1. C Gillespie

    C Gillespie Guest

    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
     
    C Gillespie, May 24, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. okaminer
    Replies:
    3
    Views:
    313
    okaminer
    Aug 1, 2005
  2. Learner
    Replies:
    4
    Views:
    2,126
    Learner
    Jan 27, 2006
  3. Replies:
    3
    Views:
    487
    Jason
    Apr 28, 2008
  4. Alexey Vlasov
    Replies:
    2
    Views:
    1,952
    Alexey Vlasov
    Dec 2, 2008
  5. Marc Heiler
    Replies:
    1
    Views:
    153
    Stefan Lang
    Jan 26, 2008
Loading...

Share This Page