python零碎知识点

1.argparse

2.replace


1.argparse

  argparse tutorial地址:https://docs.python.org/3/howto/argparse.html#introducing-positional-arguments

2.replace

  replace()方法把字符串中的old(字符串)换成new(字符串),若指定第三个参数,则是规定替换不超过n次

>>>str = "this is string example....wow!!! this is really string"
>>>print str.replace("is", "was")
thwas was string example....wow!!! thwas was really string

猜你喜欢

转载自www.cnblogs.com/ylwn/p/11494373.html