Python学习笔记(二)

1.range函数

2.Unicode

  ASCII字符集使用7bits来表示一个字符;UTF-8表示一个字符是可变的

 3.list的append方法

(1)描述

append()方法用于在列表末尾添加新的对象;

(2)语法

list.append(obj)

(3)实例

alist={'1541256','1415'};
alist.append(2009)
print 'alist'

4.dir(_builtins_)

该命令将列出所有内置函数

help()命令查看帮助

5.python标准库

操作系统接口os

数学math,random

网络通信socket

应用程序接口Tkinter

时间datetime

绘图turtle

6.Python中的os模块

os.name
os.getcwd()
os.remove('filename')
os.path.isfile((path))

 7.random模块

import random
print(random.randint(1,10)) #产生1到10的一个整数型随机数

print(random.random())
print(random.uniform(1.1,5.4))

a=[1,3,5,6,7];
random.shuffle(a)
print(a)

8.socket模块(套接字)

socket函数是对文件的操作(读写、打开、关闭)

是任何一种计算机网络通讯中最基本的内容。

import socket

9.Tkinter

Python的GUI界面

label/Frame/text/button/listbox/scrollbar/entry

10.datetime

 计算机内,把1970年1月1日00:00:00 UTC+00:00时区的时刻称为epoch time

原文地址:https://www.cnblogs.com/Sonny-xby/p/9983886.html