ValueError: insecure string pickle

“are much more likely than a never-observed bug in Python itself in a functionality that’s used billions of times a day all over the world”: it always amazes me how cross people get in these forums. One easy way to get this problem is by forgetting to close the stream that you’re using for dumping … Read more

OCaml mod function returns different result compared with %

Python is a bit different in its usage of the % operator, which really computes the modulo of two values, whereas other programming languages compute the remainder with the same operator. For example, the distinction is clear in Scheme: In Python: But in OCaml, there’s only mod (which computes the integer remainder), according to this table and as stated in the documentation: Of course, you can implement … Read more

How can I tail a log file in Python?

So, this is coming quite late, but I ran into the same problem again, and there’s a much better solution now. Just use pygtail: Pygtail reads log file lines that have not been read. It will even handle log files that have been rotated. Based on logcheck’s logtail2 (http://logcheck.org)

How to change python version in Anaconda?

A better (recommended) alternative is to create a virtual environment of the desired Python version and then use that environment to run Tensorflow and other scripts. To do that, you can follow the instructions given here. BUT, if you don’t want to create a separate environment, then conda install python=<version> should do. OR (not recommended) you can download the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)