This is a question about Python program packaging and distribution. I installed SomeProgram from the Internet that requires Python. It works exactly like it's supposed to. There is only one single file that I can find associated with it located in \usr\bin\ It does not have a ".py" file extension, but I can open in it Python's IDLE text editor. There are just a few lines and less than 100-bytes long.
Also, it runs within BASH and accepts arguments and lots of options including some like -h for help or --verbose for alternate output. I wouldn't know it's a python program except that my understanding is that it's written in python.
I'm understanding that the code here is instructing it to import itself. The file is the SAME NAME [wrong see update] as the file it's asking to import, and there is no .py extension for the actual filename. Here is the code, [I've swapped out the name with SomeProgram because its a commercial enterprise name I don't want to print online]:
#!/usr/bin/python
import SomeProgram
if __name__ == '__main__':
SomeProgram.main()
I want to understand where the main() source code is and learn from it. The program is fairly complex but I can't find it.
UPDATE:
Problem solved. While finding the source code using the posted help below, I discovered that the file-name and and imported package-name are actually different. There is a hyphen within the python filename in my /usr/bin/ location, while the import-name has an underscore. It turns out that the source code is here: /usr/lib/python2.7/dist-packages/SomeProgram
SomeProgram.__file__......