开发者

How to access a static file in controller in turbogears

I have an XML file in /my_project/public/xml/file.xml, that I want to read and parse it in one method in controller. The file can be easily accessed through a template, bu开发者_如何学编程t I have no experience with accessing files in controller.


the more simple I know : jest get the diname of base of the project filename = os.path.join(os.path.dirname(myproject.__file__), 'public', 'xml', 'file.xml')

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜