摘要: # strip() 返回数据类型为字符串# strip()去除头和尾的指定字符;# 如果没有指定,默认去掉头和尾的空格 str_1 = " he llo " # he lloprint(str_1.strip())str_2 = ",,,,,,,he,l,lo,,,,,,," # 返回 he,l,l 阅读全文
posted @ 2018-07-03 17:01 薏米* 阅读(426) 评论(0) 推荐(0)
摘要: Windows系统下,这种情况发生在读取文件,再写入过程中出现。 原因是读完文件后python不知道当前文件位置在哪里。 方法一是:在关闭文件前只做读或者写一种操作。 方法二是:在写入文件前使用file.seek()函数,指定插入/读取文本的位置 一点的方法是在写入文件前用fseek(),或者fse 阅读全文
posted @ 2018-07-03 16:38 薏米* 阅读(4347) 评论(0) 推荐(0)
摘要: 目录处理 OS目录处理目录-->路径,文件夹 文件:html 1. 新建和删除一个目录import os #引入os目录from xx import xxos.mkdir("D:\\PycharmProjects\\RobotFramework\\vda_pakage\\Learning\\pyth 阅读全文
posted @ 2018-07-03 14:21 薏米* 阅读(298) 评论(0) 推荐(0)
摘要: Configure Git for the first time: git config --global user.name "xxxxx xx"git config --global user.email "xxxxx@xxxxx" git config --global color.ui tr 阅读全文
posted @ 2018-07-03 11:20 薏米* 阅读(291) 评论(0) 推荐(0)