Python ping Module

:Download Paste v0.2 code backup #!/usr/bin/env python""" A pure python ping implementation using raw socket. Note that ICMP messages can only be sent from processes running as root. Derived from ping.c distributed in Linux's netkit. That

Configure python in linux

In fact, it is very easy to configure python in linux. 1. Check whether python has been installed on your linux server. Enter the following command line: Python-V If the version information is displayed, it indicates that python has been installed

Rapid cluster deployment using python and shell

Recently, ganglia has been deployed one by one in the cluster. cacti is very troublesome and has written a small program for automatic batch deployment. The principle is that python pexpect uses ssh to copy files and execute system commands. I use

Batch delete file lists using Python

Batch delete file lists using Python Environment: The list of objects to be deleted is known, that is, the objects to be deleted are determined. The Code is as follows: #! /Usr/bin/env python# Coding = UTF-8# Purpose: to delete a specified file list

One-click LAMP installation script (written in Python)

In brief, this is an automatic installation script written in python. It can help you automatically deploy LAMP. Secondly, due to the time, the current deployment is relatively incomplete and the defects are as follows: 1: You cannot select a

Install pyramid and create a project in linux

1. Install the python Virtual EnvironmentCopy codeThe Code is as follows:Virtualenv -- no-site-packages env 2. Install pyramidCopy codeThe Code is as follows:$ Env/bin/easy_install pyramid 3. Use the alchemy template to create a projectCopy

Python uses ElementTree to operate XML to get the node reading attribute beautifying XML

1. Import to WarehouseThree classes, ElementTree, Element, and SubElement, which create subclass classes, are required.From xml. etree. ElementTree import ElementTreeFrom xml. etree. ElementTree import ElementFrom xml. etree. ElementTree import

Example of how python uses mysqldb to connect to a database

Copy codeThe Code is as follows:#-*-Coding: UTF-8 -*- # MysqldbImport time, MySQLdb# ConnectionConn = MySQLdb. connect (host = "localhost", user = "root", passwd = "", db = "test", charset = "utf8 ")Cursor = conn. cursor ()# WriteSQL = "insert into

Python thread learning example

Copy codeThe Code is as follows:# Encoding: UTF-8Import threadImport time# A function used for execution in a threadDef func ():For I in range (5 ):Print 'func'Time. sleep (1)# End the current thread# This method is equivalent to thread. exit_thread

Python BASICS (file input/output built-in dictionary operations)

I. Variables and expressions Copy codeThe Code is as follows:>>> 1 + 12>>> Print 'Hello world'Hello world>>> X = 1>>> Y = 2>>> X + y3 Python is a strongly typed language and cannot be automatically parsed and converted to a suitable type based on

Python simulated logon to Baidu Post Bar (Baidu Post Bar logon) instance

  Copy codeThe Code is as follows: #-*-Coding: UTF-8 -*- # Python3.3.3 Import sys, time, re, urllib. parse, urllib. request, http. cookiejar, random, math, OS. path, hashlib, json, binascii, threading "" Cookie """Cookie = http. cookiejar.

Example code for reading python files row-by-row Processing

Copy codeThe Code is as follows:Import OS # for OS. path. isfile () Def dealline (line ):Print (line) # I can do many things for line Def getfilename ():Return input ('Please input file name (input exit () for exit): '). strip () Class more: # MORE

Python: the first and last language you need

I did not care about the comparison between Python and Java. However, I was amazed at the author's point of view. Since I started using Python, I have never been able to express the wonderful experience it brings to me in words. Compare other

Ruby or Python?

Recently, I need a fast development language. Currently, the hot and fast development languages are Python and Ruby. Ruby and Python are both excellent scripting languages. Although their design philosophy is almost completely different, they are

Dialogue with the father of Python: the path to success in Python (1)

Guido van rosum, father of Python, talked about the history of Python, the impact of the ABC language, and the initial design goal of Python. Guido van rosum is the author of Python. Python is an explanatory and interactive object-oriented

Python 2.6 is expected to be released this month.

Python October 1 was officially released in 2.6. This is a transitional version. Developers are expected to release the latest Python 3.0 this month. Despite this, Python 2.6 still contains some new features and syntaxes from 3.0. It is compatible

How to install Python correctly?

When installing Python, you should pay attention to the relevant knowledge. The so-called Python is an object-oriented, literal translation computer programming language, and also a powerful and complete general-purpose language. Currently,

How to compile Python code

Python calling is very practical in daily work. You only need Python functions. If you are not familiar with Python code, you must first learn the following, the following is a systematic analysis and research on the Python code. After removing

Summary of several notable features of Python applications

Python applications are a rising star in the software development field. Most developers often regard the Python language as a strict scripting language, unexpectedly, the Python language is powerful enough to be used in industrial software

Python source code compilation tips

The following describes in detail the Python source code programming skills and the spelling rules of Python source code. First, let's take a look at what is the Python language, the so-called Python: it is an object-oriented, literal translation

Total Pages: 4013 1 .... 4007 4008 4009 4010 4011 .... 4013 Go to: GO

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.