What should be the name of the python file that defines a module foo?
module.py
foo_module.py
module_foo.py
foo.py
Share
What should be the name of the python file that defines a module foo?
module.py
foo_module.py
module_foo.py
foo.py
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Answer:
Option 2nd
Explanation:
Among the four options given in question statement, the correct option is second one, that is foo_module.py
A foo directory can be added in python file, by using the environment variable PYTHONPATH and then specify the python file.
For example, to add foo, one can write as;
PYTHONPATH= /foo_module.py
There is also an alternate method for adding the foo directory
For example, one can write as;
sys.path.append (foo_module.py)