- 博客(15)
- 收藏
- 关注
原创 大数据纠错
1.权限不够sudo+原代码2. 找不到文件看文件名有没有写对或文件是否在当前目录3.配置JAVA环境时,jdk为JDK1.7export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_794.进行hadoop操作时,要启动hadoopstart-dfs.sh5.用Xshell时连接不到虚拟机看虚拟机有没有打开6.创建新文件夹失败mkdir创建多层目录时需要在后面加一个 -p 选项7.SSH无密码登陆子节点失败主节点和子节点编码格式不一致———————————
2021-06-24 23:24:07
186
2
原创 bmi
import randomimport tkinterimport tkinter.messageboxdef b_clicked():if name_Entry.get() == ‘’:tkinter.messagebox.showerror(title=‘Error’, message=‘请输入用户名字’)else:cin_name = name_Entry.get()try:text_check = ‘’.join(j for j in age_Entry.get() if j in
2020-12-24 08:28:11
112
1
原创 bmi计算
import tkintertk = tkinter.Tk()tk.title(“BMI计算器”)tk.geometry(“400x400”)Bmi1 = tkinter.StringVar()Bmi2 = tkinter.StringVar()label_height = tkinter.Label(tk,text = “身高”)label_height.place(x = 10,y = 10,width = 80,height = 40)entry_height = tkinter.En
2020-12-17 08:32:50
299
1
原创 12.10,弹窗课程内容
import tkinterdef msgbox():tkinter.messageboxroot = tkinter.Tk()button = tkinter.Button(root,text=’ 点击弹出’,command=msgbox)button.place(x=20, y=20, height=30, width=80)xuehao = tkinter.StringVar(root)entryXuehao = tkinter.Entry(root, width=150, textva
2020-12-10 10:39:52
207
原创 12.10上课
class BMI:def __init__(self, name, age, weight, height): self.name = name self.age = age self.weight = weight self.height = height self.bmi = self.weight / (self.height * self.height) def get_name(self): print(self.name) r
2020-12-10 10:38:53
108
原创 12月3上课
定义类class Student:def __init__(self, name, xuehao, phone): self.name = name self.xuehao = xuehao self.phone = phone def say_hello(self): print("你好, 我是{n}".format(n=self.name)) def __print_sentence(self): print("我的电话号码是{m}".fo
2020-12-03 12:14:08
69
原创 12.3
新建代码仓库(云端 github,gitee,etc)创建一个仓库仓库的url:本地代码上传到新建的云端仓库本地的代码仓库(本地文件夹)启动Git Bash命令Linux操作命令:pwd # 显示当前所在的路径cd 路径 # change directory, 进入指定的路径下进入了本地的代码仓库(文件夹)ls -a # ls:list,-a:all 显示出当前路径下所有的文件及文件夹初始化当前文件夹作为一个Git的代码仓库git init添加到本地仓库,登记下想把哪些文件提交到本
2020-12-03 10:53:12
69
原创 新约瑟夫游戏
def move(players,step):num=step-1while num>0:tmp=players.pop(0)players.append(tmp)num=num-1return playersdef play(players,step,alive):list1=[i for i in range(1,players+1)]while len(list1)>alive:list1=move(list1,step)list1.pop(0)return lis
2020-12-03 08:14:43
185
原创 约瑟夫100人,遇9淘汰,剩1人
list1=[i for i in range (1,100)]print(list1)while len(list1)>1:list2=list1[0:2]list1.append(list2[0])list1.append(list2[1])del list1[0:9]print(list1)[10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
2020-11-26 11:47:54
78
原创 约瑟夫50人,遇4淘汰,剩3个
list1=[i for i in range (1,50)]print(list1)while len(list1)>3:list2=list1[0:2]list1.append(list2[0])list1.append(list2[1])del list1[0:4]print(list1)[5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3
2020-11-26 11:45:33
61
原创 11.26上课
def qiuhe(x, y):“”"用于求和的函数。Input:X:接收1个实数;Y:接收1个实数。Output:返回x+y的计算结果"""z = x + yreturn zresult = qiuhe(1,2) # 函数的调用
2020-11-26 10:37:35
67
原创 约瑟夫游戏
list1=[i for i in range (1,39)]print(list1)[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39]while len(list1)>2:list2=list1[0:2]list1.append(list2[0])
2020-11-26 10:20:37
66
原创 作业
stu = {}keys = [1,2,3,4]values = [‘zhs’,‘ls’,‘ww’,‘zhl’]i = 0for key in keys:stu[key] = values[i]i+=1print(stu){1: ‘zhs’, 2: ‘ls’, 3: ‘ww’, 4: ‘zhl’}%%writefile suiji.py创建一个字典stu,key是学号,value是姓名学生信息在stu.csv文件里,从文件中读取并保存到字典打开stu.csv文件file = ope
2020-11-26 08:22:58
181
原创 数字游戏
import randomcomputer=random.randint(1,100)while True:number=int(input(“请输入100以内的整数:”))if(number>computer):print(“大了”)elif(number<computer):print(“小了”)else:print(“恭喜你赢了”)break
2020-11-19 08:30:52
96
原创 词语词频统计
import stringpath = ‘C://Users/Yang/Desktop/Walden.txt’with open(path,‘r’) as text:words = [raw_word.strip(string.punctuation).lower() for raw_word in text.read().split()]words_index = set(words)counts_dict = {index:words.count(index) for index in wor
2020-11-19 08:26:10
285
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人