Create a scriptThere are many different shells in Linux, but usually we use Bash (Bourne again shell) for Shell programming because bash is free and easy to use. So the script I've provided in this article is all about using bash (but in most cases
The top command is a common performance analysis tool under Linux that shows the resource usage of individual processes in the system in real time, similar to the Task Manager for Windows. Here is a detailed description of how it is used. Top is a
Menu function, perform display#!/bin/bash#菜单选择功能, execute the commandWhile True #无限循环DoClearEcho '-----------------------------'Echo ' 1.Display Cpu INFO: 'Echo ' 2.Display system load: 'Echo ' 3.Display Mem and swap INFO: 'Echo ' 4.Display
1. Time CalculationStarttime= 'Date+'%y-%m-%d%h:%m:%s''; Endtime=`Date+'%y-%m-%d%h:%m:%s''; Start_seconds=$(Date--Date="$starttime"+%s); End_seconds=$(Date--Date="$endtime"+%s);EchoEnd_seconds-start_seconds2. Get the status code returned by the
Because it's important to drink water every day.Directory structure:├─bin││start.py│││└─__pycache__│start.cpython-36.pyc│├─core││src.py│││└─__pycache__│src.cpython-36.pyc│└─logAccess.logCode content:start.py1 """2 Description:3 Author:nod4 Date:5
With no perfect software, enough and easy-to-use software is perfect. To sort out the code for these days today# -*- coding: utf-8 -*-import osimport sysimport cmdfrom cdctools IMPORT*CLASSPYCDC (cmd. CMD): def __init__ (self): #
Python Standard libraryThe Python standard library is installed with Pthon and contains a number of extremely useful modules.1. SYS module SYS module contains system-corresponding functions
SYS.ARGV---contains command-line arguments, the
A. Serialization Module1.Json2.pickle3.shelveB. Hashlib Module (Digest algorithm)C. Configparser ModuleD. Logging moduleE. Collections ModuleF. Random ModuleG. Time ModuleTime.sleep (sec) # (thread) sleeps the specified number of seconds. 1 O'Clock
The difference between OS and sys two modules in Pythonofficial explanations of ? OSOs:this module provides a portable the by using operating system dependent functionality.This module provides a convenient way to use the operating system functions.
********************OS module:Os.remove () deleting filesOs.unlink () deleting filesOs.rename () Renaming filesOs.listdir () lists all files in the specified directoryOs.chdir () Change the current working directoryOS.GETCWD () Gets the current file
When operator new requests a memory failure, it will perform the following processing steps:1. If there is a client-specified handler function, call the handler function (New_handler) and throw an exception if it does not exist.2. Continue to
One, the Java graphical interface1.AWT java.awtjdk1.4 before the introduction of the graphical interface, written in C + +, cross-platform is not good2.swing javax.swingjdk1.4 when the graphical interface, the cross-platform of goodSecond, the
SYS.ARGV command parameter list, the first element is the path of the program itself
Sys.exit (n) exit program, exit normally (0)
Sys.version get version information for Python interpreter
Sys.maxint the largest Int value
Sys.path
C + + 's father Bjarne Stroustrup in the C + + programming Language: The authors of a library can detect runtime errors, but generally do not know how to deal with them (because they are related to the user's specific application), on the other hand,
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.