2022年1月6日

学习python第n天——我在看笨办法学python

摘要: 代码 def add(a, b): print(f"ADDING {a} + {b}") return a + b def subtract(a, b): print(f"SUBTRACTING {a} - {b}") return a - b def muitiply(a, b): print(f 阅读全文

posted @ 2022-01-06 20:05 何奈时 阅读(37) 评论(0) 推荐(0)

2022年1月5日

学习python第n天——我在看笨办法学python

摘要: 代码串 from sys import argv script, input_file = argv def print_all(f): print(f.read()) def rewind(f): f.seek(0) def print_a_line(line_count,f): print(li 阅读全文

posted @ 2022-01-05 21:29 何奈时 阅读(43) 评论(0) 推荐(0)

2022年1月4日

学习python第n天——我在看笨办法学python

摘要: 这是所有的代码 def cheese_and_crackers(cheese_count,boxes_of_crackers): print(f"You have{cheese_count} cheeses!") print(f"You have {boxes_of_crackers} boxes 阅读全文

posted @ 2022-01-04 16:03 何奈时 阅读(24) 评论(0) 推荐(0)

2022年1月3日

学习python第n天——我在看笨办法学python

摘要: 代码块 #this is like your scripts with argv. def print_two(*args):#def含义define(定义) arg1 , arg2 = args print(f"arg1:{arg1},arg2:{arg2}") #ok,that *args is 阅读全文

posted @ 2022-01-03 17:51 何奈时 阅读(27) 评论(0) 推荐(0)

2022年1月1日

学习python第n+1天——我在看笨办法学python

摘要: #-*-coding: utf-8-*- from sys import argv ''' 此处引用了新的内置函数,exists函数是检查括号内字符串所代表的文件名的文件是否存在, 存在返回True,不存在返回False。 os.path os.path模块主要用于文件的属性获取,在编程中经常用到 阅读全文

posted @ 2022-01-01 10:19 何奈时 阅读(49) 评论(0) 推荐(0)

2021年12月6日

学习python第n+1天——我在看笨办法学python(更多的文件操作)

摘要: 这次的代码,并没有成功,现在在检查问题,也希望大家给予帮助 from sys import argv from os.path import exists script, from_file, to_file = argv print(f"Copying from {from_file} to {t 阅读全文

posted @ 2021-12-06 19:27 何奈时 阅读(64) 评论(0) 推荐(0)

2021年12月2日

学习python第n''''天——我在看笨办法学python(读写文件)

摘要: 这是所有的代码 from sys import argv sceipt, filename = argv print(f"We are going to erase {filename}.") print("If you don't want that , hit CTRL-C (^C).") pr 阅读全文

posted @ 2021-12-02 18:39 何奈时 阅读(106) 评论(0) 推荐(0)

学习python第n'''天——我在看笨办法学python(读取文件)

摘要: 这是读取文件的内容 This is stuff I typed into a file.It is really cool stuff.Lots and lots of fun to have in here. 这是代码 from sys import argv script, filename = 阅读全文

posted @ 2021-12-02 17:13 何奈时 阅读(72) 评论(0) 推荐(0)

学习python第n''天——我在看笨办法学python(提示和传递)

摘要: 这是所有的语言 from sys import argv script, user_name = argvprompt = '> ' print(f"Hi {user_name}, I'm the {script} script.")print("I'd like to ask you some q 阅读全文

posted @ 2021-12-02 12:03 何奈时 阅读(40) 评论(0) 推荐(0)

学习python第n'天——我在看笨办法学python(参数,解包,变量)

摘要: 这是所有的语言 from sys import argv#read the WYSS section for how to run this.#ex3.py是参数。# argv 是参数变量(argument variable)。#import的作用是调用参数特性,这些导入的特性称为模块(module 阅读全文

posted @ 2021-12-02 11:29 何奈时 阅读(113) 评论(0) 推荐(0)

导航