Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Python Notes-Notes from the initial phase

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Http://edu.51cto.com/course/course_id-527.html free video

Used to handle system management tasks and Web programming

Https://www.python.org/ official website

C language is machine code, which compiles code into machine code.

Cpython,.py files are compiled into bytecode

1. Installation and use under windows

Linux is built-in, no need to install

Log in to the home page to download: www.python.org, version 3.3x and 2.7x, download 2.7x

It is recommended to install version 3.x or above, which is already compatible with 2.7.

2. Small examples

Define variable: xroom12

Print x: print (x)

3. The basic structure of python program

Input

Variable assignment

Input statement

Deal with

Arithmetic operation

Logical operation

Algorithm processing

Output

Printout

Write to a file

Write to database

The whole process of variable assignment, arithmetic operation and printout

X = 12

Y = 10

Z = x + y

Print (z)

-- input statement-algorithm processing-printout

Str1 = raw_input ("plz input a string:")-- enter a string on the keyboard to assign the variable to str1

Plz input a string:www.11test.blog.51cto.com

Print (str1)-print string

Www.11test.blog.51cto.com

N = len (str1)-- count how many characters there are in str1

Print (n) print character

twenty-five

4. Python output statement and input statement

Output: print () function

Print × ×, floating point, string data

Print (1000)

one thousand

Print (12.54545)

12.54545

Print ('dd')

Dd

Print ('www.11test.blog.51cto.com')

Www.11test.blog.51cto.com

Print ('a')

A

Print () formatted output

Print (format (val,fomat_modifier))

Val: valu

Format_modifier format word

Print 12.345678

12.345678

Print (format (12.345678)

12.35

Print (format (12.345678)

Print (format (12.345678)

12.346

'm.nf 'indicates that m is the number of digits printed and n is the number of decimal places printed.

Print () Statistical percentage

Print (format (0.34567). 2%') print percentile system

Query help

Help (raw_input)

Str1 = raw_input ()

Www.11test.blog.51cto.com

Print str1

Www.11test.blog.51cto.com

Type (str1)

Age = raw_input ('you age:')-all you read are strings

You age:22

Age = int (age)-Type conversion to int

Age = age + 1

Age

twenty-three

Print xpenary y-print the values of X and Y on one line

5. Variable parsing-no data type

Variables: variable quantities, changes to addresses, like pointers in C language

Xroom12 x points to the memory unit where the 12 is located, and the change is to point to the

Ylegs 13 y points to 13 memory units

Id function, which returns the memory address

6. Some processes of learning python

1. Basics: data types, process control, modules, functions, iterators, decorators, recursion, iteration, reflection, object-oriented programming, Sims game development

two。 Network programming: Socket Cramps programming, Twisted network framework, web crawler development

Multi-threaded, multi-process, cooperative gevent,select/poll/epoll

Producer-consumer model, distributed monitoring software development, audit system development, ftp server development, batch commands, file distribution

3.web basic development

Html/css,dom programming, native js learning, jquery, easyui,angulajs

Ajax asynchronous loading, highchart drawing, bootstrap

4. Algorithm & Design pattern

Bubble, binary tree, hash, split half; factory mode, singleton mode, shared meta mode agent mode

5.py web framework

MVC framework, self-development of a web framework, django/tornado/flask/bottle/webPY framework learning

Session, Middleware, ORM, cookie, CSRF, FORM

Restful api framework, rights management background development, development of bbs forums, development of web chat rooms

6. Project actual combat

Shopping mall development

Host management + task scheduling + operation and maintenance audit fortress machine development

Distributed nagios, zabbix monitoring product development

Cmdb asset management development, IP/DNS resource pool management platform development

Development of website access quality Monitoring and Analysis platform based on user's Perspective

Secondary development of OpenStack

7. Some applications and technical frameworks of python

Python application

Web framework: Django,Pyramid,bottle et al., Flask

Development software: Buildbot,trac,roundup

Operation and maintenance three swordsmen: Ansible,salt,openstack

Financial: scipy,pandas,ipython

Code: unicode,utf,hashcode,ascii

Install 3. 0, install pycharm-IDE development tools: set environment variables

Create a project

#! / usr/bin/env python

Print "Hello World" 2.7

Print ("Hello World") 3.0

Assignment, variable

Name = "alex Li"

Age = 21

Eval ('n'): find n and take the value out

Print printing

The raw_input keyboard enters a string and assigns the variable to str1

Len counts how many characters there are.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report