Пример #1
0
import p01

stu = p01.Student('shenwei', 24)
stu.say()

p01.sayHello()
Пример #2
0
import p01 as pp
stu = pp.Student("junjun", 30)
stu.say()
pp.sayHello()
Пример #3
0
from p01 import Student,sayHello
stu = Student()
stu.say()
sayHello()
Пример #4
0
import p01 as p

stu = p.Student()

stu.say()
p.sayHello()
Пример #5
0
#-*- coding:UTF-8 -*-

import p01
# 引入模块p01的标准模式

stu = p01.Student('wujian', 29)
stu.say()

p01.sayHello('wujian')
Пример #6
0
# _*_ coding:UTF-8 _*_

# 选择性导入,模块内容
from p01 import Student, sayHello

stu = Student('wujian')
stu.say()
sayHello('BOX')
Пример #7
0
import p01

stu = p01.Student("xiaojign", 19)

stu.say()

p01.sayHello()
Пример #8
0
import p01 as a
print(a.sayHello())
std = a.Student("a",1)
print(std.say())
Пример #9
0
import p01 as module1

stu = module1.Student("yty", 19)

stu.say()

module1.sayHello()
Пример #10
0
from p01 import Student, sayHello


stu = Student()

stu.say()


sayHello()
Пример #11
0
# -*- coding: utf-8 -*-
# Author: IMS2017-MJR
# Creation Date: 2019/5/5
import p01  # 导入这个模块,就相当于将模块中的代码粘贴到了这里并执行一遍,所以其中print等代码会直接执行,最好不要有。
stu = p01.Student("cjx", 22)
stu.say()
p01.sayHello()

print("#" * 50)

import p01 as p
stu = p.Student("anran", 22)
stu.say()
p.sayHello()

print("#" * 50)

from p01 import Student, sayHello
stu = Student("cwy", 0)  # 此时p01.的前缀都不需要,否则会报错
stu.say()
sayHello()
Пример #12
0
import p01 as tuling

stu = tuling.Student("xiaojing", 20)

stu.say()

tuling.sayHello()