`
linvar
  • 浏览: 257515 次
  • 性别: Icon_minigender_1
  • 来自: 未定
社区版块
存档分类
最新评论

python notes(1)

阅读更多
1. Argument passing:
   When known to the interpreter, the script name and additional arguments thereafter are passed to the script in the variable sys.argv, which is a list of strings. Its length is at least one; when no script and no arguments are given, sys.argv[0] is an empty string. When the script name is given as '-' (meaning standard input), sys.argv[0] is set to '-'. When -c command is used, sys.argv[0] is set to '-c'. When -m module is used, sys.argv[0] is set to the full name of the located module. Options found after -c command or -m module are not consumed by the Python interpreter’s option processing but left in sys.argv for the command or module to handle.

2. Source Code Encoding
   # -*- coding: utf-8 -*-
   by using UTF-8 (either through the signature or an encoding declaration), characters of most languages in the world can be used simultaneously in string literals and comments. Using non-ASCII characters in identifiers is not supported. To display all these characters properly, your editor must recognize that the file is UTF-8, and it must use a font that supports all the characters in the file.

3.Brief Tour of the Standard Library
  The os module provides dozens of functions for interacting with the operating system:
  The glob module provides a function for making file lists from directory wildcard searches
  Command Line Arguments are stored in the sys module’s argv attribute as a list.
  The sys module also has attributes for stdin, stdout, and stderr. The latter is useful for emitting warnings and error messages to make them visible even when stdout has been redirected:
  The re module provides regular expression tools for advanced string processing.
  The math module gives access to the underlying C library functions for floating point math
  The random module provides tools for making random selections
  There are a number of modules for accessing the internet and processing internet protocols. Two of the simplest are urllib2 for retrieving data from urls and smtplib for sending mail:
  The datetime module supplies classes for manipulating dates and times in both simple and complex ways.
  Common data archiving and compression formats are directly supported by modules including: zlib, gzip, bz2, zipfile and tarfile.
 
分享到:
评论

相关推荐

    Python Notes

    这个“Python Notes”是针对初学者的一个全面教程,旨在帮助他们理解Python的基础并逐步进阶到更高级的概念。 **1. Python基础** Python的基础包括变量、数据类型、操作符和控制结构。变量用于存储数据,数据类型...

    Python notes.pages

    Python notes.pages

    Python Notes for Professionals

    The Python Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow. This open book is licensed under a Creative ...

    各类速查表汇总-Python Notes/Cheat Sheet

    - integer:整数,如-1、0、1,或Python最大整数`sys.maxint`。 - long:长整数,以L结尾,如1L或9787L。 - float:浮点数,如3.***。 - 复数:例如inf表示正无穷,-inf表示负无穷,nan表示非数字(Not a Number)。...

    PythonIntro.pdf

    Python是一种流行的高级编程语言,以其简洁清晰的语法和强大的功能而闻名。它是一种解释型、交互式、面向对象的编程语言,广泛应用于Web开发、人工智能、科学计算、数据分析、系统自动化等多个领域。Python易于学习...

    Python Scientific lecture notes

    用python来进行科学计算 Python for scientific computing We introduce here the Python language. Only the bare minimum necessary for getting started with Numpy and Scipy is addressed here.

    python notes.ipynb

    python 数据分析基础知识学习笔记,基础知识,从零基础学习python在数据处理上的应用,包含code及运行结果。python的基础数据结构。此文件为第一章节

    Python-Notes.rar_overview_python programming

    这个文档“Python Notes.pdf”很可能是对Python编程的全面介绍,涵盖了Python的基本概念、语法结构以及编程实践。 1. **基础语法** - 变量:Python中的变量可以动态赋值,类型包括整型(int)、浮点型(float)、...

    Python Learning

    Python Learning notes Python Learning notes Python Learning notes Python Learning notes

    如何设置Lotus Notes收发Internet邮件

    #### 1. 选择邮件协议(POP或IMAP) 首先,用户需要确定所使用的邮件服务提供商支持的协议类型,通常为POP(Post Office Protocol)或IMAP(Internet Message Access Protocol)。这两种协议都有其独特的优势,其中...

    python-notes22.zip_zip

    1. **Python基础知识**:包括Python的历史、安装过程、开发环境的设置(如Anaconda、PyCharm等),以及Python的解释器和交互式shell的使用。 2. **Python语法**:如变量、数据类型(整型、浮点型、字符串、布尔型、...

    python-notes:Python学习笔记:memo:

    python笔记 Python笔记学习笔记 :memo: 介绍 有时候想找一个东西(写法),但当下却忘记关键字,所以整理一篇学习笔记,要找资料的时候也比较方便。 有些是网路上找的范例,然后自己再修修改改,或者去参考一些...

    Python科学讲座笔记Python Scientific Lecture Notes

    科学的Python生态系统的教程资料,快速介绍了中心工具和技术。 从初学者到专家,每个不同的章节都对应一个1到2个小时的课程,其专业水平不断提高。

    plot_notes_python画图_Python画图通用设置代码_python_源码

    "plot_notes_python画图_Python画图通用设置代码_python_源码"这个主题聚焦于如何使用Python进行高效且美观的图形绘制,特别关注多y轴图表以及通用图形设置。下面将详细介绍其中涉及的关键知识点。 首先,Python中...

    scipy-lecture-notes, 关于科学 python 生态系统的教程材料.zip

    scipy-lecture-notes, 关于科学 python 生态系统的教程材料 Scipy-Lecture-Notes这个知识库收集一些关于科学 python 生态系统的讲座笔记,可以用在科学计算的整个过程中,并使用 python 。这些文档是用rest标记语言...

    lanms#learning-notes#安装python3.61

    所有我们自己安装python3安装python3全部命令 root权限yum -y groupinstall "Development tools" && yu

    python+selenium+unittest环境搭建1

    在notes文件中注明了Chrome与chromedriver各版本的对应关系。 四、安装 MySQL 驱动 安装MySQL驱动需要使用pip工具,打开命令行,切换到Scripts目录,输入pip install pymysql命令,即可安装MySQL驱动。 五、解决 ...

    python-总复习题12.2 (1).goodnotes

    python-总复习题12.2 (1).goodnotes

    Python_Study Notes For Web Hacking Web安全学习笔记.zip

    首先,"Python_Study Notes For Web Hacking"这部分内容可能包含了以下几个关键知识点: 1. Python基础:Python是Web黑客技术中常用的编程语言,因为它简洁、易读且拥有丰富的库支持。学习Python的基础语法、数据...

Global site tag (gtag.js) - Google Analytics