What is meant when a piece of code is said to be portable?
I have seen in many documentations that a piece of code is portable. Can anyone explain to me exactly what it means to call a piece of code portable?
I have seen in many documentations that a piece of code is portable. Can anyone explain to me exactly what it means to call a piece of code portable?
Since we can’t find a version on the Internet, let’s start one here.Most ports to Windows probably only need a subset of the complete Unix file.Here’s a starting point. Please add definitions as needed.
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. 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 constants (e.g. ‘xy’) are valid, although rarely useful … Read more
Look at getpass module 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 other).“
is more portable because in general the program /usr/bin/env can be used to “activate” the desired command without full path. Otherwise, you would have to specify the full path of the Python interpreter, which can vary. So no matter if the Python interpreter was in /usr/bin/python or in /usr/local/bin/python or in your home directory, using #!/usr/bin/env python will work.