Skip to content

Tag: python

Flask-Uploads Permission Denied

I’m using Flask Uploads for an upload form in my Flask application. However, whenever I try to save a file I get this error: It seems like uploads doesn’t have the necessary permissions to save files? Here’s the configuration I’m using for flask-uploads: Also, here’s how I save t…

How does Python babel round numbers?

I’m building a financial website with the Flask framework and I’m currently writing unit tests for it. I’m using the Babel package to format money amounts and I hit upon rather strange rounding behaviour. I would expect rounding to be up in case of a 5, or to at least be consistent. But look…

Print timestamp for logging in Python

I want to print the current timestamp, when an event succeeded or not in my python script. By only adding… …. at the beginning of each line, te same date appears in every line (I added time.sleep(5)in between) My next idea was to create a function, calling the current time, but i’m failing a…