`
- 浏览:
254439 次
- 性别:
- 来自:
未定
-
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.
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
各类速查表汇总-Python Notes/Cheat Sheet 基础命令介绍
Python notes.pages
Python学习笔记。个人认为这是一个很不错的python入门教程。
用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 数据分析基础知识学习笔记,基础知识,从零基础学习python在数据处理上的应用,包含code及运行结果。python的基础数据结构。此文件为第一章节
A Quick, Painless Tutorial on the Python Language。
Python Learning notes Python Learning notes Python Learning notes Python Learning notes
如何设置Lotus Notes收发Internet邮件
python笔记 Python笔记学习笔记 :memo: 介绍 有时候想找一个东西(写法),但当下却忘记关键字,所以整理一篇学习笔记,要找资料的时候也比较方便。 有些是网路上找的范例,然后自己再修修改改,或者去参考一些...
科学的Python生态系统的教程资料,快速介绍了中心工具和技术。 从初学者到专家,每个不同的章节都对应一个1到2个小时的课程,其专业水平不断提高。
The document provides an overview of Python language and basic programming tutorial.
scipy-lecture-notes, 关于科学 python 生态系统的教程材料 Scipy-Lecture-Notes这个知识库收集一些关于科学 python 生态系统的讲座笔记,可以用在科学计算的整个过程中,并使用 python 。这些文档是用rest标记语言...
所有我们自己安装python3安装python3全部命令 root权限yum -y groupinstall "Development tools" && yu
python-总复习题12.2 (1).goodnotes
资源分类:Python库 所属语言:Python 资源全名:notes-0.3.0.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
对应学习笔记打jupiter-lab jupyter Notebook打开文档。 请下载压缩包后将文件放入jupiter-lab jupyter Notebook的工作目录中。 如有任何疑问请私信,我会在收到信息后尽快回复您。
Python画图,自己整理的参考代码,适合于科研作图,多y轴作图,图形格式通用设置
Digital notes on data structure using python
Notes and code used in my [**Python and OpenCV course**](https://youtube/oXlwWbU8l2o) on [freeCodeCamp.org](http://freecodecamp.org). You can find me on [Twitter](https://twitter.com/jasmcaus) for ...