Concise Python Tutorials

Source: Internet
Author: User
Tags command line

Linux and BSD users

If you are using a Linux distribution such as Fedora or Mandrake or other (your choice), or a BSD system such as FreeBSD, you may already have Python installed in your system.

To test whether you have Python installed with your Linux package, you can open a shell program (like Konsole or gnome-terminal) and enter the command python-v as shown below.

$ python-v

Python 2.3.4

Comments

$ is the prompt for the shell. Depending on your operating system settings, it may not be the same as yours, so I only use the $ symbol to represent the prompt.

If you see some version information as shown above, you already have Python installed.

If you get a message like this:

$ python-v

Bash:python:command not found

So you haven't installed Python yet. This is almost impossible, but it is extremely rare to encounter.

In this case, you have two ways to install Python on your system.

Use the package management software that comes with your operating system to install binary packages, such as Fedora Linux yum, Mandrake Linux URPMI, Debian Linux apt-get, FreeBSD, and so on. Note that you need to connect to the Internet with this method.

You can also download a binary package from somewhere else and copy it to your PC for installation.

You can compile Python from the source code and install it. There are compiled instructions on the Web site.

windows® Users

windows® users can access the Python.org/download and download the latest version from the site (the latest version is the 2.3.4 version at the time of writing). It is about 9.4MB in size and is very compact compared to most other languages. The installation process is similar to other Windows software.

Tips

Even if the installer provides you with the option not to check the optional components, you don't have to do any checking! Some components are useful to you, especially the integrated development environment.

Interestingly, about 70% of the Python downloads are from Windows users. Of course, this does not explain the problem, because almost all Linux users have installed the system by default Python.

Using Python in the Windows command line

If you want to invoke Python from the Windows command line, you need to set the path variable correctly first.

For Windows 2000, XP, 2003, click Control Panel-> System-> advanced-> environment variables. In the System variables form, click the variable called path, and then edit the variable to put; C:python23 added to its end. Of course, it's the correct directory name for Python.

For older versions of Windows, add the following line to the file c:autoexec. BAT Medium: path=%path%; C:python23, and then reboot the system. For Windows NT, the Autoexec.nt file is used.

Summarized

For Linux systems, it's possible that you've installed Python in your system. Otherwise, you can install Python via the package management software that comes with your distribution. For Windows systems, installing Python is simply downloading the installer and double-clicking it. From now on, we'll assume that you've installed Python in your system.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.