FAQ

On 6/20/2011 2:51 AM, Stephen Bunn wrote:

Thanks for the replies. I would like to use the second method because I
plan to implement everything in python.
The main problem of your second method is that you repeat the check
function in each script. That will be a problem if you ever want to
modify it. I might put is into a separate file and import into each script.

Unfortunately I have not been
able to work out how to get the imports to work.

import config_script obviously doesn't work and
__import__(config_script) works from the python interpreter but fails in
the script (ImportError: Import by filename is not supported.)
Look at builtin function __import__(filename).


--
Terry Jan Reedy

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 7 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedJun 20, '11 at 4:13a
activeJun 21, '11 at 12:34a
posts7
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase