Movatterモバイル変換
[0]ホーム
function pointers
Max Møller Rasmussenmaxm at normik.dk
Thu Apr 26 05:55:38 EDT 2001
> From: Brandon J. Van Every [mailto:vanevery at 3DProgrammer.com]> I get the feeling that Python doesn't have anything> resembling a function> pointer? i.e. no way to call a specific function according> to the value a> variable is set to?Might this be what you are looking for?def hello():return 'hello'def world(): return 'world'functions = {}functions['hll'] = hellofunctions['wrld'] = worldprint functions['hll']()print functions['wrld']()regards Max M
More information about the Python-listmailing list
[8]ページ先頭