Multi-character constant warnings

According to the standard (§6.4.4.4/10) The value of an integer character constant containing more than one character (e.g., ‘ab’), […] is implementation-defined. long x = ‘\xde\xad\xbe\xef’; // yes, single quotes This is valid ISO 9899:2011 C. It compiles without warning under gcc with -Wall, and a “multi-character character constant” warning with -pedantic. From Wikipedia: Multi-character … Read more

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