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


Groups > comp.lang.python > #59801

Fire Method by predefined string!

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <th982a@googlemail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'method.': 0.07; 'string': 0.09; 'methods,': 0.09; 'statements': 0.09; 'subject:string': 0.09; 'def': 0.12; 'assume': 0.14; 'converted,': 0.16; 'param': 0.16; 'print': 0.22; 'header:User-Agent:1': 0.23; 'skip:_ 10': 0.34; 'received:google.com': 0.35; 'possible': 0.36; 'from:addr:googlemail.com': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'called': 0.40; 'fire': 0.65
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=1h+c8++knsfkCXE9Fi21OhBpP0WjNdjLfDREFyzmtEI=; b=WJ/GE/6qneK+2EqZ/5iGfCrE6Eg7EQIMGDHjMg8Nup7N+XF8NA08SsK3FgKwFc9+m5 Tz8iDIAgMjpv7NvCjwfN4+Y3xRCSGStXXfzna2WOxqOu3+r9NcY7iqVY73CzlREDQu48 pUf/dHhN7YgrZeb0Nwh5CXej9Gx9RkNkgrSVqi6QBHCCfwLnPHUBiHnFUpULNqcTqKJG Vel0lMgjKo0RFZ0b28AS9u+CszTjCzw44JvJzjKCDocCcKfvY/d8SmB5qiSfSL3sBGGK VvfpQZ93DS4hty+qE53JgYmp6JbRLTSgGGoyCGryRd/k8V5jafx4u4kynoksWf+CdVlG RU9g==
X-Received by 10.14.113.137 with SMTP id a9mr7317499eeh.3.1384724778205; Sun, 17 Nov 2013 13:46:18 -0800 (PST)
Date Sun, 17 Nov 2013 22:46:16 +0100
From Tamer Higazi <th982a@googlemail.com>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0
MIME-Version 1.0
To python-list@python.org
Subject Fire Method by predefined string!
X-Enigmail-Version 1.5.2
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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>
Newsgroups comp.lang.python
Message-ID <mailman.2807.1384725251.18130.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1384725251 news.xs4all.nl 16004 [2001:888:2000:d::a6]:45298
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:59801

Show key headers only | View raw


Hi people!

Assume we have 2 methods, one called Fire and the other __DoSomething.

I want the param which is a string to be converted, that I can fire
directly a method. Is it somehow possible in python, instead of writing
if else statements ???!



Tamer


class(object):
    def Fire(self,param)
        #possible ?!
        self.__param():


    def _DoSomething(self):
        print 'I did it!'

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


Thread

Fire Method by predefined string! Tamer Higazi <th982a@googlemail.com> - 2013-11-17 22:46 +0100
  Re: Fire Method by predefined string! Roy Smith <roy@panix.com> - 2013-11-17 17:20 -0500
    Re: Fire Method by predefined string! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-18 01:41 +0000
      Re: Fire Method by predefined string! Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-18 02:29 +0000
  Re: Fire Method by predefined string! Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-17 14:23 -0800
    Re: Fire Method by predefined string! Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-17 14:38 -0800

csiph-web