What is the difference between venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv, etc?

Recommendation for beginners: This is my personal recommendation for beginners: start by learning virtualenv and pip, tools which work with both Python 2 and 3 and in a variety of situations, and pick up other tools once you start needing them. PyPI packages not in the standard library: virtualenv is a very popular tool that creates isolated Python environments … Read more

Is it possible to ignore one single specific line with Pylint?

Pylint message control is documented in the Pylint manual: Is it possible to locally disable a particular message? Yes, this feature has been added in Pylint 0.11. This may be done by adding # pylint: disable=some-message,another-one at the desired block level or at the end of the desired line of code. You can use the message code or … Read more

Convert bytes to int?

Assuming you’re on at least 3.2, there’s a built in for this: int.from_bytes( bytes, byteorder, *, signed=False ) … The argument bytes must either be a bytes-like object or an iterable producing bytes. The byteorder argument determines the byte order used to represent the integer. If byteorder is “big”, the most significant byte is at the beginning of the byte array. If byteorder is “little”, the most significant byte is … Read more

Effect of using sys.path.insert(0, path) and sys.path(append) when loading modules

Because python checks in the directories in sequential order starting at the first directory in sys.path list, till it find the .py file it was looking for. Ideally, the current directory or the directory of the script is the first always the first element in the list, unless you modify it, like you did. From documentation – As initialized upon program … Read more