PHP » PYTHON |
login |
register |
about
|
|
To [i]include_once[/i] a file.py in python:
¶
[code=python] ¶ import file ¶ [/code] ¶ ¶ Successive call don't have any effect as in [i]include_once[/i] directive as described in [url=http://docs.python.org/tutorial/modules.html]python documentation[/url]: ¶ ¶ [quote] ¶ For efficiency reasons, each module is only imported once per interpreter session. Therefore, if you change your modules, you must restart the interpreter – or, if it’s just one module you want to test interactively, use reload(), e.g. reload(modulename). ¶ [/quote] ¶ ¶ ¶ |