After saving as a. py file, run the script to add the process name later. For example: Python proinfo.py QQ can get information on the process of QQ, note that the case is not case-sensitive
Copy Code code as follows:
#-*-Encoding:utf-8
One, Java endFirst I use the Java WebService Support package to write the server and the release program, the code is as follows.WebService Interface Code:
Copy Code code as follows:
Package com.xxx.test.ws;
Import
Example one:
Python uses the WMI module to obtain hardware information for the WINDOWNS system: Hard disk partitions, usage, memory size, CPU model, current running process, Self starter program and location, system version, and more.
Copy
First, use the built-in method and the decorator method to get the class name, function name
The case of getting a function name in Python is divided into internal and external, from the outside to get, using the object pointing to the function,
Environment: "Wind2003[open Tftp Server] + VIRTUALBOX:UBUNTN10 Server"Tftp:open TFTP ServerUbuntnPython + pyexpectVirtual machine Reason: Pyexpect does not support windows
Note: Originally intended to use SECRUECRT script, because the practice
is a simple python query Baidu keyword ranking function, here are some brief introduction:1, UA Random2, simple and convenient operation, direct GetRank (key words, domain name) can be3, code conversion. There should be no problem with coding.4, the
Recently took over more and more things, the release and operation of the work is quite mechanical, coupled with the frequency is quite high, resulting in time wasting or more advantages. Fix bugs, test, submit version library (2 minutes), SSH to
1. Ways to take the past specific time:
Copy Code code as follows:
#!/usr/bin/python
Import time#取一天前的当前具体时间Time.strftime ('%y-%m-%d%T ', Time.localtime (Time.time () -24*60*60))
#取15天前的当前具体时间Time.strftime ('%y-%m-%d%T ',
For more information, refer to the JSON documentation within Python:Python>>> Help (JSON)or Official document: Http://docs.python.org/library/json.html#module-json.
Here's a simple example of using Python to parse JSON:
Copy Code code as
1, half open socket
Using the shutdown () function, the bidirectional data transmission of the socket becomes one-way data transfer. Shutdown () requires a separate parameter that indicates how to close the socket. Specific: 0 means to prohibit
This section is an example of the use of Wxpython frame.
Example:
Copy Code code as follows:
#!/usr/bin/python
#-*-CODING:GBK-*-
# simple.py
Import WX
App = WX. APP ()
frame = wx. Frame (None)
Frame. Show ()
Do server-side development of the students should be monitoring the process will not be unfamiliar, recently happened to replace Uwsgi as Gunicorn, and Gunicorn and just have such a chapter on process monitoring, so much research.
Combined with
The first time in Python to write this more practical and fun things, the right to be a practicing bar
Game Description:
* P key controls pause/start* Direction key control the direction of the greedy snake
The source code is as follows:
Touch Python also has a period of time, Python related frameworks and modules have also contacted a lot, hoping to contact their own feel better than the design and realization of sharing to everyone, so took a "charming Python" small mark, is to
In the process of using Python-written applications, you sometimes encounter situations where multiple files pass the same global variable. In this paper, the following solutions are given for your reference.
File 1:globalvar.py
Mainstream Web Server A slap can count out, Apache,lighttpd,nginx,iis
Application, Chinese name is to do application service, you are based on a Web framework written application code DB server refers to storage services, Web development in the use
The example described in this article is a method for Python to process a text file and generate a specified format file, as shown in the following functional code:
Import OS import sys import string #以指定模式打开指定文件 get file handle def
Features such as finding and deleting folders and files are implemented in the OS module. You need to pilot into this module when you use it,
The methods for importing are:
Import OS
First, get the current directory
s = OS.GETCWD ()
# s saves
Built-in functionsCommon functions
1. Mathematics relatedABS (x)ABS () returns the absolute value of a number. If a complex number is given, the return value is the modulus of the complex number.
Copy Code code as follows:
>>>print
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