IT Ninja
IT Ninja

Reputation: 6430

Python Bottle hangs

So i have just gotten bottle (via their page with only code [I think it was github?]) anyways, i have the server up and running, however, when i press ctrl+c sometimes it does not immidiately break, and im wondering if im doing something wrong? my code is as follows:

This is my serving code:

from Bottle import route,run,template

@route('/')
@route('/<name>')
def hello(name='noob'):
    return template('Templates/maintemplate',name=name)
run(host='WorkPC-PC',port=9999,debug=True)

This is my template code (although i dont think this makes a difference, i included it to make sure):

<html>
<head>
<body>
%if name:
    <h1>{{name}}</h1>
%else:
    <h1>hello stranger</h1>
%end
</body>
</head>
</html>

Upvotes: 2

Views: 1190

Answers (1)

Jesse
Jesse

Reputation: 5074

Is it not terminating at all, or just taking a second or two to stop? If it's just taking a couple seconds it might be running multiple threads and waiting for them all to shutdown. I tried your code with a pip-installed version and couldn't replicate your issue.

Upvotes: 1

Related Questions