Take the 2-minute tour ×

I'd like to provide a program, for example a Python script, that can be run on platforms including Linux, Mac, and Windows. I want the program to read the content of a few files in the directory, and create a new file in that directory based on the content. Specifically, I want the program to find file1.txt and file2.txt, and create a new file file3.txt which is a concatenation of the first two files.

I might provide a Python script to a Linux user, and the user can run

python script.py

However, Windows does not have Python. What other choices of programs do I have that will allow it to be run on these platforms, without the user having to install anything extra?

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

You could use C++, but then you'd have to compile for each platform, which is sometimes more work than you'd like.

Most systems have some form of Java installed already, which could work.

Python runs on Windows, Mac and Linux, the user would just need to install it.

share|improve this answer
add comment

I am not aware of anything that will run on all OSes without any extra work. However, Java may be a good choice as it is commonly installed. You could use C++ but you would have to compile it on each machine you would like it to work on (Windows, Mac, Linux) you would also have to make sure you don't use any library that does not transfer to the other OSes.

share|improve this answer
I see. How about makefiles? Would that be a possibility? –  John Nov 1 '12 at 2:33
@John unfortunately I don't know enough to answer that, but maybe. My experience with programming has been with Visual Studio and XCode which do most things for me. But, in what i've seen I've never seen a makefile used for compiling on Windows. I know that reading and writing from a file is the same for all platforms in C++ #include<fstream> I don't know about listing files in the directory (if that is something you're doing) if not you should be fine compiling on whatever platform. –  Travis Pessetto Nov 1 '12 at 2:38
add comment

Your Answer


