In order to avoid copy-update issues whereby code is unnecessarily copied, code can be made relocatable.
What is relocatable code?
Relocatable code is code that can determine where it is running and make appropriate decisions.
Examples:
host name
Windows or Linux
client or server
command line or web service
Python version 2 or 3
Here is the Python code [#1]
Here is the output of the Python code.
In general, some way is needed to handle file paths between Windows and Linux.
Windows: drive letters (or UNC paths) and backward slashes
Linux: volume roots and forward slashes
I generally use a
pfix routine (for path fix) throughout the code as needed.
Other operating system commands may need to be abstracted as necessary.