![]() When the above code is executed, it produces the following result − 13Ī module is loaded only once, regardless of the number of times it is imported. For example, to import the module module.py, you need to put the following command at the top of the script − import module A search path is a list of directories that the interpreter searches before importing a module. When the interpreter encounters an import statement, it imports the module if the module is present in the search path. The import has the following syntax − import module1 You can use any Python source file as a module by executing an import statement in some other Python source file. Return 2*height*width The import Statement We have a file called module.py which has following content: def sum(num1,num2): An installation-dependent list of directories configured at the time Python is installed. ![]() (Theįormat for PYTHONPATH is OS-dependent but should mimic the PATH environment variable.)
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |