- 博客(13)
- 收藏
- 关注
原创 大数据错题
hadoop上传文件失败解决方法:因为之前搭建了集群,所以在传文件之前要启动集群,启动集群的代码如下:start-dfs.shstart-yarn.shmr-jobhistory-daemon.sh start historyserver上传文件后,如果重复上传文件,调用文件内容时,报出没有该文件的错误。解决方法:删除该文件,rm (文件路径)集群搭建的错误修改文件时,在hadoop中输入代码时用了sudo vim mapred-site.xml(文件 mapred-site
2021-06-24 22:11:19
268
原创 猜数字的界面版
import tkinterimport tkinter.messageboxroot = tkinter.Tk()root.title('猜数字')shuzi=tkinter.StringVar()Label = tkinter.Label(root,text="请输入1到100以内的整数")Label.place(x=20,y=10,width=140,height=40)sg = tkinter.StringVar(root)Entrysg =tkinter.Entry(roo
2020-12-15 19:44:03
225
原创 BMI测试的界面版
import tkinterimport tkinter.messageboxroot = tkinter.Tk()root.title('BMI的测试')bmi=tkinter.StringVar()Label = tkinter.Label(root,text="身高")Label.place(x=20,y=10,width=30,height=20)Label=tkinter.Label(root,text="m")Label.place(x=90,y=10,width=30,he
2020-12-13 18:32:11
466
原创 BMI的计算
BMI的计算%%writefile BIM.pyclass BMI: def __init__(self,name,age,weight,high): self.name = name self.age = age self.weight =weight self.high = high def print_bmi1(self): getBMI=self.weight/(self.high*self.hig
2020-12-07 19:43:59
380
1
原创 随机点名
import randomn=random.randint(1,4)dict={1:'小李',2:'小万',3:'小新',4:'小王'}dict[n]
2020-11-19 08:39:39
284
原创 添加行号
f=open('demo.py','r').readlines()f_out=open('demo_new.py','w')s=1for a in f: a=f.replace('\n', '#'+str(s)+\n) s=s+1 f_out.write(a)
2020-11-15 13:19:12
112
原创 统计Walden中单词出现的次数
import collectionsf=open(r'C:\Users\86156\Desktop\Walden.txt','r')str1=f.read().split(' ') m=collections.Counter(str1) #用于统计元素出现的次数print(m)
2020-11-15 09:39:24
228
原创 2020-11-10
while循环中continue和break的不同break语句是直接跳出整个循环,比如;s=0while s >= 0: s=s+1 if s == 6: break 当s=6时,跳出while循环continue语句是跳出这一次的循环比如:s=2while s>0: s=s-1 if s==1: continue print(s) 所以s是0...
2020-11-10 19:38:00
70
原创 元组,字典,集合
元组# 元组tuple1=('元素1','元素2') # 用圆括号创建元组,每一个元素后都要加逗号。tuple2=() # 创建一个空的元组元组不能像列表一样进行增减和修改tuple=(1,2,3)print(tuple[0]) # 用于元组的提取print(tuple[-1::-1]) # 取倒数第一个到左端的所以元素print(tuple[0:3]) # 取元组中第一个到第三个的元素``t
2020-11-10 12:12:39
224
原创 猜数字
1到100内的猜数字import randomn=random.randint(1,100)i=5while i > 0: x=input("请输入1到100以内的整数:") if x < n: print("比要猜的数小") i=i-1 elif x > n: print("比要猜的数大") i=i-1 else : print("恭喜你猜对了") br
2020-11-09 22:02:55
139
原创 git的使用
git的使用第一步在gitee注册账号并且绑定邮箱。第二步在“我的”中创建一个仓库。如何快速设置直接使用地址 https://gitee.com/cai-hangdian/artificial-201.gitGit 的设置 ;git config --global user.name “" 填用户名git config --glodal user.email "*********” 填邮箱地址创建特性分支git checkou -b $featu
2020-11-01 15:12:42
74
原创 Markdown的使用说明
Markdown的使用说明1.标题的大小“#”加空格,"#"越多标题越小。如下;11112.加粗,用四个 “*” 分别在加粗内容的左右两边各放两个3.斜体样式 ,用两个 * 分别在内容的左右两边各放一个。效果如下;斜体样式3.删除线格式,用四个“~”分别在左右两边粉两个。效果如下;删除线格式4.无序列表 用 *加空格。效果如下;124.在这里插入图片描述打入图片的网址,如下;(https://img-blog.csdnimg.cn/20201024221704677
2020-10-24 22:27:03
86
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人