#\n 换行注释可表示多行信息输出
\t制表
print内三层注释用于表示多行信息输出
print('566')
"""
#
\n 换行注释可表示多行信息输出
\t制表
print内三层注释用于表示多行信息输出
print('asd fgh \ mm')
print('asd fgh \n mm')
print('asd fgh \t mm')
"""
"""
asd fgh \ mm
asd fgh
mm
asd fgh mm
"""
#字符串大小写转换 .lower() .lower()函数,
startswith(被判断对象)判断字符串的开始,endswith(字符)判断是否包含字符结束
"""
#字符串大小写转换 .lower() .lower()函数
sp='hello lindar 1 2 3 4 5 6'
print(sp[-1])
print(sp[0:5])
sp1=sp.upper()
print(sp1)
sp2=sp.lower()
print(sp2)
print(sp2.isupper())
print(sp.startswith('he'))
print(sp.endswith('8'))
"""
"""
6
hello
HELLO LINDAR 1 2 3 4 5 6
hello lindar 1 2 3 4 5 6
False
True
False
"""
#字符串函数 :join split。可将字符串列表转换为字符串函数
#split()函数还原#rjust() ljust()对齐方法
#删除空白字符 strip 删除两边空格,lstrip()删除左边空格,lstrip删除右边
#字符串函数 :join split。可将字符串列表转换为字符串函数
"""
#join()函数在每个字符串中间加入字符
>>> ','.join(['a','s','d'])
'a,s,d'
>>> ' '.join(['a','s','d'])
'a s d'
>>>
#split()函数还原
>>> 'a s d f'.split()
['a', 's', 'd', 'f']
>>> 'acscdcf'.split('c')
['a', 's', 'd', 'f']
#rjust() ljust()对齐方法
>>> sp.rjust(20)
' absulote'
>>> sp.ljust(20)
'absulote '
>>> sp.center(20,'-')
'------absulote------'
>>> sp.rjust(20,'+')
'++++++++++++absulote'
#删除空白字符 strip 删除两边空格,lstrip()删除左边空格,lstrip删除右边
>>> sp=' abc '
>>> sp.strip()
'abc'
>>> sp.lstrip()
'abc
>>> sp='asdfga'
>>> sp.strip()
'asdfga'
#指定字符串可删除
>>> sp.strip('a')
'sdfg'
>>> '
"""
实例
"""
import pyperclip
pyperclip.copy('abc123')
sp=pyperclip.paste()
print(sp)
passwords={'a':'1254191758','b':'excelenter','c':'8'}
import sys,pyperclip
#print(sys.argv[1]) #路径表达式
if len(sys.argv)<2 :
print('Usage :python t6.py [account] - copy account password')
sys.exit()
account ='c'
if account in passwords:
pyperclip.copy(passwords[account])
print('password has copyed'+account)
else :
print('no account'+account)
"""
"""
566
abc123
Usage :python t6.py [account] - copy account password
"""
"""
#无序列表,分离行
import pyperclip
t=pyperclip.paste()
line=t.split('\n')
for i in range (len(line)):
line[i]='*' +line[i]
print(line[i])
t=pyperclip.copy(t)
print(t)
"""
"""
*line=t.split('\n')
*for i in range (len(line)):
* line[i]='*' +line[i]
*
*pyperclip.copy(t)
None
""