I have a fair background in java, trying to learn python. I\'m running into a problem understanding how to access methods from other classes when they\'re in different file
from a directory_of_modules, you can import a specific_module.pyspecific_module.py, can contain a Class with some_methods() or just functions()specific_module.py, you can instantiate a Class or call functions()Class, you can execute some_method()Example:
#!/usr/bin/python3
from directory_of_modules import specific_module
instance = specific_module.DbConnect("username","password")
instance.login()
Excerpts from PEP 8 - Style Guide for Python Code:
Modules should have short and all-lowercase names.
Notice: Underscores can be used in the module name if it improves readability.
A Python module is simply a source file(*.py), which can expose:
Class: names using the "CapWords" convention.
Function: names in lowercase, words separated by underscores.
Global Variables: the conventions are about the same as those for Functions.