def f_module(): print("f_module()") mymodule.myfunc() mymod.myfunc() my = mymod.MyClass() my.mymethod()
from mymodule import myfunc # the moment we import a module all the indentetion level 0 codes will run # so here mymoodule has __name__ == __main__ check at indentation level 0 which runs print("I am at indentation 0 ") myfunc() if __name__ == '__main__': print("mymainpy am getting executed as main file") #myfunc()
def test_1(): from mymodule import myfunc print("testing...") assert myfunc()
#!/usr/bin/env python # -*- coding: utf8 -*- """De fortran à python avec f2py""" # Importation et aide import mymodule help(mymodule) print mymodule.myfunc.__doc__ # Utilisation import numpy as N a = N.arange(3.) print mymodule.myfunc(a)
from mymodule import myfunc myfunc() # this is the first commit #comment added in new folder #One more line added to check the add command of git
# Importing hand-made modules. # The name of the module corresponds to the 'mymodule.py' file in current directory. import mymodule mymodule.myfunc() print(mymodule.s(8, 9)) # __name__ gives you the name of the current package. For the main script, it will be set to '__main__'. # Inside a module, it will keep the name of a module (which is its namespace). print(__name__)
#!/usr/bin/env python # -*- coding: utf8 -*- """De fortran à python avec f2py""" # Importation et aide import mymodule help(mymodule) print mymodule.myfunc.__doc__ # Utilisation import numpy as N a = N.arange(3.) print mymodule.myfunc(a)