随笔分类 - python
适合入门学习
摘要:import osimport re#获取本机用户名,构建student.txt文件名创建在左面import getpassusername=getpass.getuser()print("当前登录用户名"+username)filename="student.txt"filename="C:\\U
阅读全文
摘要:import requestsfrom bs4 import BeautifulSoupdef get_movies(): headers={ 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KH
阅读全文
摘要:def myfun(): num1 = int(input('输入num1')) num2 = int(input('输入num2')) list1=[] for i in range(1, max(num1, num2)): if num1 % i == 0 and num2 % i == 0:
阅读全文
摘要:#字符串处理统计类型def my_func(*str): list_num = [] list_big = [] list_small = [] list_qt = [] str = input('请输入一个字符串') for j in str: elif ord(j) > 47 and ord(j
阅读全文
摘要:import osdef alldir(path): stack=[] stack.append(path) while len(stack)!=0: dirpath=stack.pop() filelist=os.listdir(dirpath) for filename in filelist:
阅读全文

浙公网安备 33010602011771号