pig-class 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,38 @@
1
+ Metadata-Version: 2.4
2
+ Name: pig-class
3
+ Version: 0.1.0
4
+ Summary: 😊😊😊😊😊
5
+ Author-email: Your Name <your.email@example.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/yourusername/pig-class-example
8
+ Project-URL: Repository, https://github.com/yourusername/pig-class-example.git
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.6
13
+ Description-Content-Type: text/markdown
14
+
15
+ # pig
16
+
17
+ 😊😊😊😊😊
18
+
19
+ ## 功能
20
+
21
+ `Pig` 类包含以下功能:
22
+
23
+ - 初始化猪的名字、编号,年龄默认为 1。
24
+ - `age_add()`:年龄增加 1 并返回当前年龄。
25
+ - `display()`:显示猪的名字、年龄和编号。
26
+ - `modify(modify_name, modify_serial_number)`:修改名字或编号,如果某个参数为 `None` 则提示用户输入。
27
+ - `pig_play(play_content)`:打印猪玩耍的内容。
28
+ - `pig_sleep(sleep_time)`:打印猪睡觉的时长。
29
+ - `pig_eat(food, food_time, quantity_of_food)`:打印猪进食的信息。
30
+
31
+ ## 安装
32
+
33
+ 你可以将本包克隆到本地并使用 `pip` 安装:
34
+
35
+ ```bash
36
+
37
+ pip install pig-class
38
+ ```
@@ -0,0 +1,24 @@
1
+ # pig
2
+
3
+ 😊😊😊😊😊
4
+
5
+ ## 功能
6
+
7
+ `Pig` 类包含以下功能:
8
+
9
+ - 初始化猪的名字、编号,年龄默认为 1。
10
+ - `age_add()`:年龄增加 1 并返回当前年龄。
11
+ - `display()`:显示猪的名字、年龄和编号。
12
+ - `modify(modify_name, modify_serial_number)`:修改名字或编号,如果某个参数为 `None` 则提示用户输入。
13
+ - `pig_play(play_content)`:打印猪玩耍的内容。
14
+ - `pig_sleep(sleep_time)`:打印猪睡觉的时长。
15
+ - `pig_eat(food, food_time, quantity_of_food)`:打印猪进食的信息。
16
+
17
+ ## 安装
18
+
19
+ 你可以将本包克隆到本地并使用 `pip` 安装:
20
+
21
+ ```bash
22
+
23
+ pip install pig-class
24
+ ```
@@ -0,0 +1,38 @@
1
+ Metadata-Version: 2.4
2
+ Name: pig-class
3
+ Version: 0.1.0
4
+ Summary: 😊😊😊😊😊
5
+ Author-email: Your Name <your.email@example.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/yourusername/pig-class-example
8
+ Project-URL: Repository, https://github.com/yourusername/pig-class-example.git
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.6
13
+ Description-Content-Type: text/markdown
14
+
15
+ # pig
16
+
17
+ 😊😊😊😊😊
18
+
19
+ ## 功能
20
+
21
+ `Pig` 类包含以下功能:
22
+
23
+ - 初始化猪的名字、编号,年龄默认为 1。
24
+ - `age_add()`:年龄增加 1 并返回当前年龄。
25
+ - `display()`:显示猪的名字、年龄和编号。
26
+ - `modify(modify_name, modify_serial_number)`:修改名字或编号,如果某个参数为 `None` 则提示用户输入。
27
+ - `pig_play(play_content)`:打印猪玩耍的内容。
28
+ - `pig_sleep(sleep_time)`:打印猪睡觉的时长。
29
+ - `pig_eat(food, food_time, quantity_of_food)`:打印猪进食的信息。
30
+
31
+ ## 安装
32
+
33
+ 你可以将本包克隆到本地并使用 `pip` 安装:
34
+
35
+ ```bash
36
+
37
+ pip install pig-class
38
+ ```
@@ -0,0 +1,7 @@
1
+ README.md
2
+ pig_class.py
3
+ pyproject.toml
4
+ pig_class.egg-info/PKG-INFO
5
+ pig_class.egg-info/SOURCES.txt
6
+ pig_class.egg-info/dependency_links.txt
7
+ pig_class.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ pig_class
@@ -0,0 +1,49 @@
1
+ class Pig:
2
+ def __init__(self,name,serial_number):
3
+ self.name = name
4
+ self.age = 1
5
+ self.serial_number = serial_number
6
+ print(f"猪{self.name}诞生了")
7
+ def age_add(self):
8
+ self.age += 1
9
+ print(f"猪的年龄为:{self.age}")
10
+
11
+ return self.age
12
+ def display(self):
13
+ print(f"猪的名字:{self.name},猪的年龄:{self.age},猪的编号:{self.serial_number}")
14
+ def modify(self,modify_name,modify_serial_number):
15
+ try:
16
+ if modify_name and modify_serial_number == None:
17
+ whether_to_input = input("猪的名字或猪的年龄未输入,是否输入:(y/n):")
18
+ if whether_to_input == "y":
19
+ if modify_name == None:
20
+ modify_name = input("请输入猪的名字:")
21
+ self.name = modify_name
22
+ if modify_serial_number == None:
23
+ modify_serial_number = input("请输入猪的编号:")
24
+
25
+ self.serial_number = modify_serial_number
26
+ else:
27
+ print("好的,不修改")
28
+
29
+ print(f"猪的名字:{self.name},猪的编号:{self.serial_number}")
30
+ except:
31
+ print("出现问题")
32
+ def pig_play(self,play_content):
33
+ print(f"猪{self.name}玩了{play_content}")
34
+ def pig_sleep(self,sleep_time):
35
+ print(f"猪{self.name}睡了{sleep_time}小时")
36
+ def pig_eat(self,food,food_time,quantity_of_food):
37
+ print(f"猪{self.name}吃了{food},吃了{food_time}小时,吃了{quantity_of_food}克食物")
38
+ def pig_squeal(self,the_number_of_pig_calls):
39
+ print(f"猪{self.name}叫了{the_number_of_pig_calls}次")
40
+
41
+ class pigs_squeal_endlessly(Pig):
42
+ def pigs_squeal_endlessly(self):
43
+ a = 1
44
+ try:
45
+ while True:
46
+ print(f"猪{self.name}叫了{a}次")
47
+ a += 1
48
+ except KeyboardInterrupt:
49
+ print(f"猪叫了{a}次")
@@ -0,0 +1,24 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pig-class"
7
+ version = "0.1.0"
8
+ description = "😊😊😊😊😊"
9
+ readme = "README.md"
10
+ authors = [
11
+ { name = "Your Name", email = "your.email@example.com" },
12
+ ]
13
+ license = { text = "MIT" }
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: OS Independent",
18
+ ]
19
+ requires-python = ">=3.6"
20
+ dependencies = [] # 无外部依赖
21
+
22
+ [project.urls]
23
+ Homepage = "https://github.com/yourusername/pig-class-example"
24
+ Repository = "https://github.com/yourusername/pig-class-example.git"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+