that at-sign stuff still puzzles me.
Yeah, I'm not really used to the @-sign as well, just using it. ;-)
As far as I understand, those decorators return a function that replace the one you wrote and thus can modify and add more functionality to it.
More:
[spoiler]
Taken from
here:
def p_decorate(func):
def func_wrapper(name):
return "<p>{0}</p>".format(func(name))
return func_wrapper
def get_text(name):
return "lorem ipsum, {0} dolor sit amet".format(name)
my_get_text = p_decorate(get_text)
print my_get_text("John") # Outputs <p>lorem ipsum, John dolor sit amet</p>
is just the complicated way of saying:
# [...]
@p_decorate
def get_text(name):
return "lorem ipsum, {0} dolor sit amet".format(name)
print get_text( 'John' )
Notice how p_decorate does not replace get_text with itself, but returns a function 'func_wrapper' that does so. It could do more that just returning a function, e.g. register the route for the webserver I
guess. But please don't quote me on that.
[/spoiler]
BTT:Noticing that you are using Win10 and I've no clue what "IIS 8" does, yes, you may be better off with what Aodhan145 said. Getting python to run on windows and so on might not be worth the hassle, given that you already have the tools you need (which I don't know, but am just guessing).
Still, nothing beats the feeling of a headless raspberry pi 1 (yes, the old 700 mhz one
) running a python-webserver that's so easy to modify.