摘要: os.path.realpath derefences symbolic links on those operating systems which support them. os.path.abspath simply removes things like . and .. from the 阅读全文
posted @ 2018-04-13 11:17 champernain 阅读(405) 评论(0) 推荐(0)
摘要: python os.path.abspath realpath 区别 #home cd /home mkdir a mkdir b touch a/1.txt ln -s /home/a/1.txt /home/b/1.txt python 进入实时模式 >>> import os >>> os.p 阅读全文
posted @ 2018-04-13 11:16 champernain 阅读(4762) 评论(0) 推荐(0)
摘要: 一:经常使用的时间方法 1.得到当前时间 3.计算昨天的日期(发散思维,计算其他日期相加、相减等): ##二:time和datetime模块常用方法简介 表示时间的两种方式: time 模块常用方法小记 1.time.clock() 2.time.sleep(secs) 3.time.localti 阅读全文
posted @ 2018-04-12 18:19 champernain 阅读(175) 评论(0) 推荐(0)
摘要: datetime模块用于是date和time模块的合集,datetime有两个常量,MAXYEAR和MINYEAR,分别是9999和1. datetime模块定义了5个类,分别是 1.datetime.date:表示日期的类 2.datetime.datetime:表示日期时间的类 3.dateti 阅读全文
posted @ 2018-04-12 18:19 champernain 阅读(91) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2018-04-12 18:17 champernain 阅读(1) 评论(0) 推荐(0)
摘要: 在python中,命令行解析的很好用, 首先导入命令行解析模块 import argparseimport sys 然后创建对象 parse=argparse.ArgumentParser() 然后增加命令行 parse.add_argument("--learning_rate",type=flo 阅读全文
posted @ 2018-04-12 18:12 champernain 阅读(2441) 评论(0) 推荐(0)
摘要: 本文参考自: https://stackoverflow.com/questions/18393701/the-difference-between-str-and-repr?noredirect=1&lq=1 在stackoverflow上,有个兄弟问了这个问题: 首先定义一个类: 返回的是: 更 阅读全文
posted @ 2018-04-12 18:12 champernain 阅读(191) 评论(0) 推荐(0)
摘要: python 中 urlparse 模块介绍 urlparse模块主要是用于解析url中的参数 对url按照一定格式进行 拆分或拼接 1.urlparse.urlparse 将url分为6个部分,返回一个包含6个字符串项目的元组:协议、位置、路径、参数、查询、片段。 1 2 3 import url 阅读全文
posted @ 2018-04-12 18:10 champernain 阅读(801) 评论(0) 推荐(0)
摘要: 自定义matplotlib Created Saturday 08 December 2012 5.1 matplotlibrc文件 matplotlib使用matplotlibrc [matplotlib resource configurations]配置文件来自定义各种属性,我们称之为rc配置 阅读全文
posted @ 2018-04-12 18:08 champernain 阅读(490) 评论(0) 推荐(0)
摘要: Help on function rc in module matplotlib: rc(group, **kwargs) Set the current rc params. Group is the grouping for the rc, e.g., for ``lines.linewidth 阅读全文
posted @ 2018-04-12 16:59 champernain 阅读(204) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示