我正在尝试运行memory_game脚本来测试flask-ask,但是每当我尝试从命令行运行脚本时,都会出现相同的错误。我已经安装了所有必需的软件包,但得到的是相同的东西。
[HttpPost]
public async Task<ActionResult> PostBookList(BookListBinding binding)
{
var bookList = new BookList
{
Id = binding.BookId,
Title = binding.Title
});
var storeList = new StoreList
{
Id = binding.StoreId,
BookId = binding.BookId
}
// you work with _context
return CreatedAtAction("GetBookList", new { id = binding.BookId }, bookList);
}
我希望烧瓶询问能够运行,但是却得到了。有什么需要的吗?
import logging
from random import randint
from flask import Flask, render_template
from flask_ask import Ask, statement, question, session
app = Flask(__name__)
ask = Ask(app, "/")
logging.getLogger("flask_ask").setLevel(logging.DEBUG)
@ask.launch
def new_game():
welcome_msg = render_template('welcome')
return question(welcome_msg)
@ask.intent("YesIntent")
def next_round():
numbers = [randint(0, 9) for _ in range(3)]
round_msg = render_template('round', numbers=numbers)
session.attributes['numbers'] = numbers[::-1] # reverse
return question(round_msg)
@ask.intent("AnswerIntent", convert={'first': int, 'second': int, 'third':
int})
def answer(first, second, third):
winning_numbers = session.attributes['numbers']
if [first, second, third] == winning_numbers:
msg = render_template('win')
else:
msg = render_template('lose')
return statement(msg)
if __name__ == '__main__':
app.run(debug=True)
.......