Server
#! /Usr/bin/env python
Import socket
Import time
Host =''
Port = 99999
S = socket. socket (socket. AF_INET, socket. SOCK_STREAM)
S. bind (host, port ))
S. listen (2)
While 1:
Conn, addr = s. accept ()
#---------------
Print 'got connection
: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
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
[Root @ localhost Python-2.7.5] # pythonPython 2.4.3 (#1, Jun 11 2009, 14:09:58) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2Type "help ", "copyright", "credits" or "license" for more information. >>>
Just make a soft connection.
[Root @
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
Let's look at the example:Copy codeThe Code is as follows:#! /Usr/bin/python#-*-Coding: UTF-8 -*-From bs4 import BeautifulSoupHtml_doc = """ The Dormouse's story The Dormouse's story Once upon a time there were three little sisters; and their
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 is elegant. Using these libraries can make your code more concise and persistent. You are welcome to add and provide comments!
Docopt. AbandonoptparseAndargparseUsedocstringS to build an elegant, readable, and complex command line
Information provision:
Provide hotline: 51cto.editor@gmail.com
Vulnerability category:
Design Vulnerabilities
Attack type:
Local attacks
Release date:
2005-10-17
Updated on:
2005-10-17
Python Introduction
Python is a simple, easy-to-learn and powerful interpreted programming language. It has simple and clear syntax and an efficient high-level data structure, allowing you to easily and effectively implement object-oriented
Information provision:
Provide hotline: 51cto.editor@gmail.com
Vulnerability category:
Upgrade information
Attack type:
Remote attack
Release date:
2006-03-10
Updated on:
2006-03-10
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
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
Initially, table derivation was popularized through the functional programming language Haskell, which provided us with a different method of coding using the Python language, it allows us to focus on the data to be converted, rather than the
Bkjia.com exclusive Article] This article will introduce two selection statements in Python: while statements, for statements, and range, which are often used together with for statements) built-in functions. At the same time, we will also explain
Function is one of the core content of Python programming. This article first introduces you to what functions are, then introduces the function definition and calling methods in detail. Finally, we use a large number of instance codes to detail the
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
As you can see from the perspective of SICP, map and filter in functional programming can be seen as the application of pipeline ideas. However, the idea of pipelines can be used not only in functional languages, but also as long as the language
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