随笔分类 -  python

适合入门学习
摘要:import osimport re#获取本机用户名,构建student.txt文件名创建在左面import getpassusername=getpass.getuser()print("当前登录用户名"+username)filename="student.txt"filename="C:\\U 阅读全文
posted @ 2019-09-24 19:33 怪很强你先上 阅读(1882) 评论(0) 推荐(0)
摘要:import requestsfrom bs4 import BeautifulSoupdef get_movies(): headers={ 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KH 阅读全文
posted @ 2019-04-14 14:20 怪很强你先上 阅读(402) 评论(0) 推荐(0)
摘要: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: 阅读全文
posted @ 2018-11-01 08:30 怪很强你先上 阅读(3727) 评论(0) 推荐(1)
摘要:#字符串处理统计类型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 阅读全文
posted @ 2018-10-30 10:33 怪很强你先上 阅读(2508) 评论(0) 推荐(0)
摘要:import osdef alldir(path): stack=[] stack.append(path) while len(stack)!=0: dirpath=stack.pop() filelist=os.listdir(dirpath) for filename in filelist: 阅读全文
posted @ 2018-10-21 00:30 怪很强你先上 阅读(970) 评论(0) 推荐(0)