include files?

rgndrp erased*remove_this* at xs4all.nl
Fri Jun 20 13:38:24 CEST 2003


it would if i'd get it to work :)
now it returns this cgi error:

---------------8<--------------------------
The specified cgi application misbehaved by not returning a
complete set of HTTP headers. The headers it did return are:

  File "e:\_cgi\test.cgi", line 1
    include applic.py
                 ^
SyntaxError: invalid syntax
--------------->8--------------------------

the only line in applic.py is:
myvar=5

hmpf!


Thomas Güttler wrote:

> rgndrp wrote:
> 
> > Bengt Richter wrote:
> > 
> >> On 19 Jun 2003 14:30:39 GMT, "rgndrp"
> <erased*remove_this*@xs4all.nl> >> wrote:
> >> 
> >> >hi all,
> >> >
> >> >I use python for making cgi scripts on a iis/w2k
> >> >box and i wanted to know if it is it possible to include files in
> >> >python?
> >> >like: <!--#include file="file.inc"-->
> >> >or something :)
> >> >
> >> It depends on you context. If you are in a Python source context,
> >> execfile has a similar effect to #include. Chances are there are
> >> better ways to solve your problem though.
> >> 
> >> Regards,
> >> Bengt Richter
> > 
> > what im trying to do is have a file in which i define some
> > global variables and functions such as fonts and background colors
> > and debug/database functions. i used to do this is asp with include
> > files.  any other suggestions, anyone? :)
> 
> Does this help you?
> 
> main.py:
> include variables
> if variables.myvar==5:
>    print "OK"
> 
> variables.py:
> myvar=5
> 
>  thomas





More information about the Python-list mailing list