
The above was a sample module. As you can see, there is nothing particularly special about compared to our usual Python program. We will next see how to use this module in our other Python programs. Remember that the module should be placed in the same directory as the program that we import it in, or the module should be in one of the directories listed insys.path .
#!/usr/bin/python
$ python mymodule_demo.py Hi, this is mymodule speaking. Version 0.1
Notice that we use the same dotted notation to access members of the module. Python makes good reuse of the same notation to give the distinctive 'Pythonic' feel to it so that we don't have to keep learning new ways to do things.
Describe what you're looking for in as much detail as you'd like.
Our AI reads your request and finds the best matching books for you.
Popular searches:
Join 2 million readers and get unlimited free ebooks