Is there a portable way to get the current username in Python?

Look at getpass module import getpass getpass.getuser() ‘kostya’ Availability: Unix, Windows p.s. Per comment below “this function looks at the values of various environment variables to determine the user name. Therefore, this function should not be relied on for access control purposes (or possibly any other purpose, since it allows any user to impersonate any … Read more

How do SO_REUSEADDR and SO_REUSEPORT differ?

Welcome to the wonderful world of portability… or rather the lack of it. Before we start analyzing these two options in detail and take a deeper look how different operating systems handle them, it should be noted that the BSD socket implementation is the mother of all socket implementations. Basically all other systems copied the … Read more