python备忘

1.引用已经编写好的.py文件(Windows系统)

>>>import sys

>>>sys.path.append("C:/python")

>>>import hello (hello.py文件在C:/python路径下)

 2.模块使用

(1) 模块信息一览

>>>import copy ----以copy模块为例

>>>dir(copy)     ----显示copy模块的所有对象

>>>[n for n in dir(copy) if not startswith('_')]

(2)模块信息帮助

help(copy.copy)

(3)文档信息帮助

(4)查看源代码

 

 3.Python前面加r的作用

    字符串前面加r,表示的意思是禁止字符串转义

 

posted @ 2016-08-23 09:42  fubst0318  阅读(121)  评论(0编辑  收藏  举报