# !/usr/bin/python import mymodel print( __name__) mymodel.sayHello() print( ' Version: ', mymodel.version) print( ' Model Name: ', mymodel.modelName())
mymodel.py
# !/usr/bin/python # Filename:mymode.py version = ' 1.0 ' def sayHello(): print( " Hello world ") def modelName(): return __name__ #end of model
dengwei@dengwei-laptop:~/python_test$ chmod a+x *.py dengwei@dengwei-laptop:~/python_test$ ./test.py __main__ Hello world ('Version: ', '1.0') ('Model Name: ', 'mymodel')