Jython - Configuring modules path into a jython script

旧巷老猫 提交于 2019-12-24 14:26:49

问题


Looks like function os.chdir() does not works for Jython, is there another way to switch of working directory in a Jython script ?

(Get the following error while running my script: OSError: [Errno 0] chdir not supported in Java)

Thanks in advance for any solution.

EDIT: Question title updated to match the solution. Tags too.


回答1:


What Grimmy asked make me think different about my original problem (thanks to you)

My goal is (was) to define a path to find local jython modules. And so the correct way is to update 'sys.path'.

Example:

sys.path.append(workingDirectory)

Problem solved. Thanks again Grimmy.



来源:https://stackoverflow.com/questions/18975613/jython-configuring-modules-path-into-a-jython-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!