Wednesday, August 12, 2009

Python Module

User defined module in python can be put in the same folder as the main script file. However, on our server when submitting jobs, absolute paths are needed, otherwise file won't be found. As the jobs on the server will be distributed to other machines for execution. In this case, where to put the used defined module?

One solution is creating a Shell script and call the main script using the absolute path, which is also the module's path.

Another solution is copy the user defined module into the python's installation folder, which is under the system lib folder, that's to say put the user defined module to the same place as the system modules.

No comments:

Post a Comment