testlib.pyで定義されたいくつかのメソッドを呼び出そうとしていますが、出力に「なし」という追加の理由が混乱していますか?ありがとう。追加Python 2.7での出力の出力なし
私はtestlib.py
print testlib.globalFoo()
f = testlib.Foo()
print f.getValue()
testlib.py
class Foo:
def __init__(self):
pass
def getValue(self):
print 'get value in class Foo'
def globalFoo():
print 'in global foo'
出力、
in global foo
None <= confusion here
get value in class Foo
None <= confusion here
「副作用」の機能を使用する場合です。 – Nishant