Key "python" into a terminal. If you get the python prompt (>>>) then you have Python installed. Ctrl-D exits python. Most distros will have it installed in /usr/bin, so you can also check for a /usr/bin/python2.x file.
woooee
Nearly a Posting Maven
2,454 posts since Dec 2006
Reputation Points: 777
Solved Threads: 714
You will have to find someone who has used all flavors of Linux to get an answer to that. Since that is impossible, you might have to use a bash script to check for a Python installation, and if Python is installed, if would then run the Python program.
woooee
Nearly a Posting Maven
2,454 posts since Dec 2006
Reputation Points: 777
Solved Threads: 714
Thanks
i wanted to know whether python installed as default package in all flavors of linux.
Well, then time for you to do a little data collection and research. =)
I'm sporting Ubuntu Gutsy Gibbon, and it came with Python pre-installed (although I had to install the mysqlDB package myself).
- Walkere
Walkere
Junior Poster in Training
57 posts since Jan 2008
Reputation Points: 29
Solved Threads: 5
The answer is no.
Not even Tcl is installed by default on all flavors of linux. About the only thing you can guarantee is that either /usr/bin/sh or /bin/sh is available. (And on most linuxes it is actually bash.)
You can, of course, make your install and/or start script(s) test for python and complain with a user-friendly "please install python" message if not found.
Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229
A better approach might be to create a package installer (such as a .deb or .rpm) which lists python as a dependency.
If you plan to support more linux variants than just RedHat and Debian and those that work with their package systems (which are quite a few!), you can roll your own using a program like makeself .
Hope this helps.
Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229