摘要:
# author: Roy.Gimport shutil# f1=open("test1.txt","r",encoding="utf-8")# # f1.write("大漠孤烟直,长河落日圆")# f1.flush()# f2=open("test_2.txt","w",encoding="utf 阅读全文
摘要:
# author: Roy.Gimport sys# y1=sys.version# print(y1)# print("in the sys")# a=sys.argv[1]# sys.argv.append("author is roy")# print(sys.argv)y=int(sys.a 阅读全文
摘要:
# author: Roy.Gimport os# y1=os.getcwd()# print(y1,type(y1))# y2=os.chdir("E:\\pythonlearning_2")# print(y2)## os.makedirs("E:\\a\\b\\c\\")# os.remove 阅读全文
摘要:
# author: Roy.Gimport randomy=random.random()print(y)y1=random.randint(1,9)print(y1)y2=random.randrange(0,9)print(y2)y3=random.choice([1,2,3,4,5,6,7,] 阅读全文
摘要:
# author: Roy.Gimport time# # part 1# time_time=time.time() #timestamp# print(time_time)## #part 2# time_sleep=time.sleep(2)# print(time_sleep)## prin 阅读全文
摘要:
# author: Roy.Gimport time# # part 1# time_time=time.time() #timestamp# print(time_time)## #part 2# time_sleep=time.sleep(2)# print(time_sleep)## prin 阅读全文
摘要:
# author: Roy.Gimport os,sysimport time'''from module_test import mod_1 as test_1 #change module nametest_1() # use the changed name to call it# from 阅读全文
摘要:
# author: Roy.G'''print("all >",all([0,-1,1]))print("any >",any([0,0,1]))print(" ascii ")a=ascii([0,0,1,"罗伊"])print("ascii >",[a],type(a))print("bin(% 阅读全文
摘要:
虽然convert 和 transform 都有改变的意思,但二者的用法完全不一样.convert 是强调改变(某事物)的形式和用途:如,The classroom is converted into a room.教室被改为房间了.trasform 是强调改变某人或者某物特性:如,College 阅读全文
摘要:
# author: Roy.G# from collections import iterablefrom collections.abc import Iterable,Iteratora=[1,2,3]print(isinstance(a,Iterable)) #determine if a s 阅读全文