Jānis Šlapiņš added the comment:
> that's why I'm choosing not to increase the complexity of my code
I disagree about the classification of my proposal. This is not about
increasing the complexity (changing algorithms, adding a new functionality and
so on). It is just about get
Jānis Šlapiņš added the comment:
Many examples in the internet only show the usage of the filename parameter of
basicConfig() and almost no one shows how to use the stream. That's why I
wanted to use the filename parameter. But now I tested other options and they
work for me. My case m
Jānis Šlapiņš added the comment:
Yes, it also works. But then you have also to remember to restore sys.stdout to
the initial state at the end. In addition, for non-English languages it would
be more appropriate to use codecs.open() instead of just open() in this case.
The complexity of the
Jānis Šlapiņš added the comment:
Using the stream or other options requires much more coding (for example, an
additional redirection of sys.stdout to a file) instead of just one line with
the basicConfig.
In the meanwhile, I tried to use logging.FileHandler instead where I could
specify the
New submission from Jānis Šlapiņš:
Hi!
Log files are only saved using the system default encoding.
On Windows, this means that the current ANSI code page is used. This may lead
to a disaster (exceptions may be thrown due to unmappable characters) if you
want to log particular text strings in a
New submission from Jānis :
test = "Hi there :)"
print len(test), test // Prints "11 Hi there :)"
test = test.replace(" ", "\x00")
print len(test), test // Prints "11
On Windows '\x00' is same as ' ', but on lin