954,546 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Python support in Linux

Hi,
I would like to know whether linux installed as default in all flavors of linux (redhat,suse) or in customized linux distributions.

is not so is there any other script to be supported in all linux distributions?

thanks

nirmalarasu
Newbie Poster
12 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

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
 

Thanks
i wanted to know whether python installed as default package in all flavors of linux.

nirmalarasu
Newbie Poster
12 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

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
 

I have found standalone executable kit, "PyInstaller". Using this I have made
linux binary & succesfully executed python script in machine where python is not installed.

If any body found wrong in approach please correct me.

nirmalarasu
Newbie Poster
12 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

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
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You