摘要: import timeuser,passwd = "gx","gx123"def auth(func): def wrapper(*args,**kwargs): username = input("username:").strip() password = input("password:"). 阅读全文
posted @ 2018-08-12 19:45 亚格斯123 阅读(163) 评论(0) 推荐(0) 编辑
摘要: import time# def foo():# print("in the foo")# bar()# #foo()# def bar():# print("in the bar")## foo()# bar()def bar(): #基本函数 time.sleep(4) print("in th 阅读全文
posted @ 2018-08-05 16:07 亚格斯123 阅读(62) 评论(0) 推荐(0) 编辑
摘要: x = 0def grandpa(): x = 1 print(x) def dad(): x = 2 print(x) def son(): x = 3 print(x) son() dad()grandpa() 阅读全文
posted @ 2018-08-05 16:05 亚格斯123 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 公鸡3元一只,母鸡2元一只,小鸡1元三只 100元100只 for x in range(1,33): for y in range(1,50): z = 100-x-y if (z%3 == 0) and (3x+2y+z/3=100): print(“公鸡:”%s,“母鸡:”%s,"小鸡:”%s 阅读全文
posted @ 2018-03-04 15:59 亚格斯123 阅读(247) 评论(0) 推荐(0) 编辑
摘要: oldboy_age = 5 guess_age = int(input("guess your answer:")) if guess_age == oldboy_age: print("you got it!") break elif guess_age > oldboy_age: print( 阅读全文
posted @ 2018-02-12 23:18 亚格斯123 阅读(187) 评论(0) 推荐(0) 编辑
摘要: # Author:Alex Li name = input("name:")#raw_input 2.x input 3.x#input 2.x =age = int(input("age:") ) #integer#print(type(age) , type( str(age) ))job = 阅读全文
posted @ 2018-02-12 13:47 亚格斯123 阅读(116) 评论(0) 推荐(0) 编辑
摘要: from matplotlib import pyplot as plt#cm = plt.cm.get_cmap('jet')cmap=plt.cm.spectralX = [[2, 3], [4, 5], [6, 7]]plt.imshow(X,interpolation='bicubic',c 阅读全文
posted @ 2018-02-02 10:27 亚格斯123 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1、VASP中的四个最基本文件:INCAR,POTCAR,POSCAR ,KPOINTS,再加一个提交任务所用的脚本文件 2、常用的软件:Origin(画图),winscp和putty(方便远程登录),DS VIEWES PRO(用于看结构)等; 3、计算步骤: (1)先按计算要求,编辑好输入文件。 阅读全文
posted @ 2017-12-07 22:20 亚格斯123 阅读(1929) 评论(0) 推荐(0) 编辑
摘要: 形参 实参def text(x,y): print(x) print(y)text(1,2) 位置参数调用,与形参一一对应x=1y=2 text(y=y,x=x) 显示的结果依然为x=1 y=2,因为调用text()函数只要求是x跟x对应,y跟y对应 实际的意思是text(y=2,x=1),但tex 阅读全文
posted @ 2017-12-02 15:09 亚格斯123 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 多态:一种接口,多种实现class Animal: def __init__(self, name): # Constructor of the class self.name = name def talk(self): # Abstract method, defined by conventi 阅读全文
posted @ 2017-11-18 19:40 亚格斯123 阅读(76) 评论(0) 推荐(0) 编辑