Skip to content

Commit

Permalink
fix python example (#4141)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitlinger authored Mar 13, 2024
1 parent a42f509 commit 89c35fc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions content/en/docs/languages/python/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,18 @@ app = Flask(__name__)
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)


@app.route("/rolldice")
def roll_dice():
player = request.args.get('player', default = None, type = str)
player = request.args.get('player', default=None, type=str)
result = str(roll())
if player:
logger.warn("%s is rolling the dice: %s", player, result)
logger.warning("%s is rolling the dice: %s", player, result)
else:
logger.warn("Anonymous player is rolling the dice: %s", result)
logger.warning("Anonymous player is rolling the dice: %s", result)
return result


def roll():
return randint(1, 6)
```
Expand Down

0 comments on commit 89c35fc

Please sign in to comment.