[mod_python] Re: Include directive with variable for filename

Roman Gaufman hackeron at gmail.com
Wed Dec 12 11:51:26 EST 2007


I'm currently doing:

content_file = PSP(req, filename=myfilename)
content_file.run()

If there is anyway to do the same with include or a cleaner way to  
achieve the same otherwise, any information would be very appreciated.

Roman

On 12 Dec 2007, at 13:11, Roman Gaufman wrote:

> No one has any ideas/suggestions? :(
>
> Roman
>
> On 10 Dec 2007, at 04:03, Roman Gaufman wrote:
>
>> Dear mod_python mailinglist,
>>
>> I'm trying to do:
>>
>> <%@ include file=filename %>
>>
>> filename being a variable defined earlier as code but it won't work  
>> unless I use a string for file.
>>
>> I also tried string formatting:
>>
>> <%@ include file="%s" % filename %>
>>
>> Which throws an exception :(
>>
>> Is there any work around to pass a variable to the include directive?
>>
>> Roman
>



More information about the Mod_python mailing list