Python
文章平均质量分 86
Python
4un
我是一个保安.上班只为下班.
展开
-
Python Project- Alien_invasion(外星人入侵)
Python Project- Alien_invasion(外星人入侵)Python实战小项目的详细实现原创 2022-09-17 22:59:28 · 2837 阅读 · 0 评论 -
Python - tips01
> 路径写法r的作用跟\\的作用是一致的,都是防止程序将\当作转义字符,正确的路径写法有下面三种:1、 os.path.exists('E:/test/file.txt')2、 os.path.exists('E:\\test\\file.txt')3、 os.path.exists(r'E:\test\file.txt')> input语法:x = input('提示: ')不管用户输入什么,input()函数的返回结果都是字符串,可强制类型转换。num原创 2022-06-01 16:31:18 · 261 阅读 · 0 评论 -
Python- 基础
> 输出函数print()语法:print(value,···,sep=' ',end='\n',file=sys.stdout,flush=False)//参数sep用来指定分隔符,参数end用来指定结束符//file=sys.stdout:设置输出设备, flush设置是否强制输出print()完会自动换行,可使用逗号分隔,使得可在一行输出多个value.//将数据输出到文件中fp=open('D:/text.txt','a+')print('hello',file=fp)原创 2022-03-04 21:34:58 · 453 阅读 · 0 评论