Add comments
This commit is contained in:
parent
9d5e6948a7
commit
55dee42376
10
example.py
10
example.py
|
@ -6,13 +6,13 @@ def main():
|
|||
# Some example code to test the functionality
|
||||
testpy = mfp.require("test")
|
||||
testpy.st = "Hello world"
|
||||
testpy.echo()
|
||||
testpy.echo() # "Hello world"
|
||||
testpy["st"] = "Hello world 2"
|
||||
testpy.echo()
|
||||
testpy.echo() # "Hello world 2"
|
||||
testpy = mfp.require("test")
|
||||
testpy.echo()
|
||||
testpy.echo() # Will still be "Hello world 2", since the library has been required before.
|
||||
testpy = mfp.dofile(mfp.p(mfp.sd,"module","test.py")) # Same file as used for mfp.require
|
||||
testpy.echo()
|
||||
testpy.echo() # Will be None, as it's a new instance of the library (dofile does not care)
|
||||
|
||||
def bootstrap(name,modName):
|
||||
if name in globals(): return
|
||||
|
@ -32,4 +32,4 @@ def bootstrap(name,modName):
|
|||
bootstrap("mfp","me.fier.python")
|
||||
init()
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main()
|
||||
|
|
Loading…
Reference in New Issue