Linux system uses Python to monitor Apache server process script sharing _python

crtrl.py python script to monitor the Apache server process Copy Code code as follows: !/usr/bin/env Python Import OS, sys, time While True:Time.sleep (4)Tryret = Os.popen (' ps-c apache-o pid,cmd '). ReadLines ()If Len (ret) Print

Python ways to get the current time _python

I sometimes write a program to use the current time, I want to use Python to take the current time, although not difficult, but always forget, with one lost,In order to be able to better remember, I deliberately write down the way to get the current

Python parsing XML module encapsulation code _python

Like the following XML file: Copy Code code as follows: 1 2 Here are some of the ways Python parses XML files, implemented using Python modules. Mode 1,python module implementation to automatically

Python uses Paramiko module to implement SSH remote login upload file and execute _python

Program execution requires reading two files Command.txt and ipandpass.txt. The format is as follows: Copy Code code as follows: Command.txt: Threadnum:1 Port:22 Local_dir:hello_mkdir Remote_dir:hello_mkdir

Python batch modification of file suffixes _python

Recently downloaded a lot of various tutorials, unfortunately, the suffix name is ". mp4", and I Like ". rmvb" suffix, because of a slight cleanliness, can not stand the ". mp4" suffix, but manual modification is too cumbersome, so use the recently

Python implements Batch conversion file encoding (Batch conversion encoding sample) _python

Copy Code code as follows: #-*-Coding:utf-8-*- __author__ = ' Walkskyer ' Import OSImport Glob Class Encoding:def __init__ (self):#文件扩展名Self.ext = ". *"#编码Self.srcencoding=noneSelf.dstencoding=none def convertencoding (self, content,

Python implements the socket client and server-side Simple example _python

Copy Code code as follows: Import socket #socket通信客户端 DEF client (): Mysocket=socket.socket (Socket.af_inet,socket. SOCK_STREAM) Mysocket.connect ((' 127.0.0.1 ', 8000)) Mysocket.send (' Hello ') While 1: DATA=MYSOCKET.RECV (1024) If

Python crawls the urllib2 through the Web to download the sample _python

Catching seeds through urllib2 and re modules Ideas 1. Use the program login forum (if you need to login to access the section) 2. Visit the designated forum 3. Traverse the post (first take the specified page, and then traverse the URL of all

Python subprocess Module Learning Summary _python

First, subprocess and the commonly used encapsulation functionsWhen we run Python, we're both creating and running a process. Like the Linux process, a process can fork a subprocess and let the child process exec another program. In Python, we fork

Python calculates circle circumference, area, sphere volume and draws round _python

gtk

Enter the radius, calculate the circumference, area, sphere volume of the circle, and draw the circle.Drag bars, input boxes, and image controls to keep the data consistent! Fedora under test through Copy Code code as follows: #https://

Python implementation patrol System (Solaris) sample _python

Written using Python + shell, is a simple Solaris system patrol procedure Copy Code code as follows: #!/usr/bin/python-u #-*-Coding:utf-8-*- ''' Program: solaris_status.py author:gyh9711 Function: System State Information

Use Python to draw an example of Renren buddy diagram _python

Code dependencies: Networkx matplotlib Copy Code code as follows: #! /bin/env python #-*-Coding:utf-8-*- Import Urllib Import Urllib2 Import Cookielib Import re Import Cpickle as P Import Networkx as NX Import

Using Python to implement a scan port sample _python

Python's most concise and understandable scan port code. It would be amazing to run. Copy Code code as follows: From threading import Thread, Activecount Import socket Import OS def test_port (Dst,port): Os.system (' title '

Python implementation probes socket and Web services sample _python

Operating system: LinuxSoftware Environment: Python 2.7.3 Usage: Copy Code code as follows: $./monsocket.py # This is check the URI or Socket of the script # Usage: ./monsocket.py-d URL; This is Http protocol ./monsocket.py-s

Python uses the cTYPES module to invoke WINDOWSAPI to obtain the system version sample _python

Python uses the cTYPES module to invoke the Windows API GetVersionEx get the current system version without using the Python32 Copy Code code as follows: #!c:/python27/python.exe #-*-Coding:utf-8-*- "To determine the current system

Python's ORM Framework SQLAlchemy Getting Started tutorial _python

The idea of sqlalchemy is that the scale and performance of SQL databases are important to the collection of objects, while the abstraction of object collections is important for tables and rows.One installation SQLAlchemy Copy Code code as

Python monitors network card traffic and uses the graphite drawing sample _python

Copy Code code as follows: #!/usr/bin/env python Import Sys,time From socket import socket def read_interface (in_file): With file (In_file) as F: return F.readlines () [2:] def set_interface (inter_msg): dic={} For i in Xrange (Len

An example of data processing programming from the zero-learning Python series (II.) _python

Data has changed in the previous section from the zero-learning Python series of data-processing programming instances (i), in addition to the student's results, the document added the student name and the date of birth, so it will become: according

A collection of practical methods for OS and shutil modules in Python _python

Copy Code code as follows: # OS ModuleOS.SEP can replace the operating system-specific path separator. Windows is ' \ \ ' The Os.name string indicates the platform you are using. For example, for Windows, it is ' NT ', and for Linux/unix

Examples of sending messages in Python

The sample code for sending the message is as follows: fromWebutilsImportProperitiesload fromEmail.mime.textImportMimetext fromEmail.mime.multipartImportMimemultipartImportSmtplibImportOSclasssendmails ():" "to send a message with an attachment, you

Total Pages: 4013 1 .... 1583 1584 1585 1586 1587 .... 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.