Enviar búsqueda
Cargar
Python简单介绍
•
4 recomendaciones
•
469 vistas
Guixing Bai
Seguir
Tecnología
Denunciar
Compartir
Denunciar
Compartir
1 de 42
Descargar ahora
Descargar para leer sin conexión
Recomendados
Virtual function-introduce
Virtual function-introduce
Rafael Chen
Vim 神技
Vim 神技
hotoo
Python speed up with numba
Python speed up with numba
Jiang Wu
Polar example
Polar example
Alisha Smile
Data-Driven Operations - Practice realtime data analyse
Data-Driven Operations - Practice realtime data analyse
Guixing Bai
Python and sysadmin I
Python and sysadmin I
Guixing Bai
Python for Linux System Administration
Python for Linux System Administration
vceder
Programming Under Linux In Python
Programming Under Linux In Python
Marwan Osman
Recomendados
Virtual function-introduce
Virtual function-introduce
Rafael Chen
Vim 神技
Vim 神技
hotoo
Python speed up with numba
Python speed up with numba
Jiang Wu
Polar example
Polar example
Alisha Smile
Data-Driven Operations - Practice realtime data analyse
Data-Driven Operations - Practice realtime data analyse
Guixing Bai
Python and sysadmin I
Python and sysadmin I
Guixing Bai
Python for Linux System Administration
Python for Linux System Administration
vceder
Programming Under Linux In Python
Programming Under Linux In Python
Marwan Osman
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Más contenido relacionado
Destacado
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Destacado
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Python简单介绍
1.
Python 简单介绍 Guixing Bai guixing@staff.sina.com.cn 1
2.
特点 2
3.
简单易学 3
4.
功能强大 4
5.
兼容性好 5
6.
扩展性好 6
7.
开源 7
8.
例子 8
9.
好工具 iPython 9
10.
内建函数 build-in 10
11.
print 11
12.
open, range, lambda 12
13.
map, filter 13
14.
模块 14
15.
sys,os 15
16.
time, datetime 16
17.
hashlib 17
18.
Tips 18
19.
[i for i
in lst if i] 19
20.
[i.strip() for i
in lst if i] 20
21.
def fun(arg1,arg2) d={arg1:11,arg2:22} fun(d[arg1],d[arg2]) fun(**d) 21
22.
p = [a,b,c] #want
a/b/c os.path.join(*p) 22
23.
a=[a,b,c] #want a_b_c or
a*b*c ’_’.join(a) ’*’.join(a) b=’fuck’ #want fuck! fuck!... ”%s! ” % (b) * 20 23
24.
源代码 style guide 24
25.
tab,space 25
26.
def fun(): tab>a=xx ....return a 26
27.
好 4个space 27
28.
#!/usr/bin/env python # coding=utf-8 #
-*- coding: utf-8 -*- 28
29.
#NO import os,sys #Yes import os import
sys #But from os import popen,popen2 29
30.
#Yes a = 1
+ 2 blockq = 3 + 4 #No a = 1 + 2 blockq = 3 + 4 30
31.
1行不超79 etc. 31
32.
Py3k has come 32
33.
Style Changes 33
34.
4-space ONLY 34
35.
• None, as
成了关键字 • print 成了函数 • dict.has_key 改用in操作符 • int和long没有差别了 • 所有的strings都是Unicode • 不可比的类型之间比较将出异常 • <>操作符没有了,!=代替 • apply()用f(*args,**kw)代替 • xrange()用rang()代替 • map和filter没有了,list可以管 • etc. 35
36.
Module Changes 36
37.
• Removed • sha,md5:
hashlib代替 • mimetools: email package代替 • timing: time.clock()代替 • Renamed • cPickle: _pickle • StringIO/cStringIO: 成了io的一个class • HTMLParser: http.client • BaseHTTPServer: http.server • CGIHTTPServer: http.server • SimpleHTTPServer: http.server 37
38.
路漫漫其 修远兮! 38
39.
Q&A? 39
40.
参考资料 • PEP: http://www.python.org/dev/peps/ •
8: Style Guide for Python Code • 3000: Python 3000 • 263: Defining Python Source Code Encodings • Py3k: http://wiki.python.org/moin/ Python3.0 • Python Shell Tab Completion: http:// blog.yzlin.org/2008/12/22/75/ 40
41.
• iPython: http://ipython.scipy.org/moin/ •
python常用模块: http:// wiki.woodpecker.org.cn/moin/ PyCommonUsageMod • python中文处理: http:// wiki.woodpecker.org.cn/moin/PyInChinese • Python编辑速度技巧: http:// wiki.woodpecker.org.cn/moin/PyOptimize • vim的tabstop: http://blog.khsing.net/ 2008/12/vims-tabstop.html 41
42.
Thanks! 42
Descargar ahora