Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
That's a "depends" type question. It depends on the dependencies of the python program and how it is installed on windows/mac. If all of the modules are available and installed on all three platforms and the python code isn't using any platform specific code (e.g. search the proc filesystem for stats and info which is only available on Linux) then it is highly possible the script can be run on multiple platforms with little or no modification.
As for how you run that script on the other platforms it depends on how the user installed python. In Windows if there's %PATH% and explorer integration then one could simply double click on the *.py script to run it (though it may disappear right away depending on what it is doing if it doesn't pause to show output). If there's %PATH% integration then one could also open the command prompt and run the script the same way you do on Linux.
With Mac it also depends on the package and how it integrates with the system though most recommended methods for Mac have $PATH integration. It is BSD based and uses bash for the terminal shell so just run it like you would any other.
For a more specific answer you'll need to provide more information or code samples with your question and describe the client environment.
The short-answer is that languages such as Python, Perl, PHP, Ruby and so-on are generally designed to be, at least, "operating-system agnostic." The core-language will run anywhere on anything. However, the reality is that the operating systems are different-enough to cause problems in the various edge-cases. Therefore, if you are deploying an application that is intended to be "cross-platform," a certain amount of care must be taken. Perhaps your requirements are "nowhere near 'the edge.'" On the other hand, maybe they are.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.