Marco-python-class notes 01-python

Source: Internet
Author: User

#! /usr/bin/python

The first line: The interpreter that executes the script notification content to be opened;

Import Platform

The second line: Importing a Python module platform via import;

Print Platform.uname ()

The third line: print the execution result of the Uname method of the Platform module;

Finally give the script executable permission;

2:python scripts can be divided into: modules, statements, expressions, objects;

  • The program has a modular structure
  • Module contains statements
  • Statement contains an expression
  • expression creation and processing of an object

Note: Everything in Python is an object;

3: Expression is "something"; for example: 3+4

4: The statement is "doing something"; For example: print "3+4"

5: Features of statements: they change things;

6: The assignment statement changes the variable;

The 7:print statement changes the screen output;

Second: The language is divided into

Process oriented

The instruction is the center, the instruction processes the data, how to organize the code to solve the problem;

Object oriented

Data-centric, all the processing code around the data expansion, how to design data structures, organize and provide the data to allow processing operations;

Marco-python-class notes 01-python

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.