By Swaroop C. H.
Read or Download A Byte of Python 1.92 PDF
Best programming: programming languages books
Эта энциклопедия будет интересна в первую очередь современным охотникам, любителям стрельбы по тарелочкам и коллекционерам. Написанная специалистом по оружию, она может служить справочным пособием для всех любителей охотничьего оружия.
- Semantic Integration of Heterogeneous Software Specifications
- Russian energy power and foreign relations: implications for conflcit and cooperation
- The Visibooks Guide to PHP Basics
- Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries Second Edition
- Apprendre Java et C++ en parallele, 4e edition
- Visual C# 2005 - Grundlagen, Programmiertechniken, Datenbanken
Extra resources for A Byte of Python 1.92
Getcwd()) to find out the current directory of your program. pyc files Importing a module is a relatively costly affair, so Python does some tricks to make it faster. ). pyc file is useful when you import the module the next time from a different program - it will be much faster since a portion of the processing required in importing a module is already done. Also, these byte-compiled files are platform-independent. py files. pyc files will not be created. statement If you want to directly import the argv variable into your program (to avoid typing the sys.
Then the second line is blank followed by any detailed explanation starting from the third line. You are strongly advised to follow this convention for all your docstrings for all your non-trivial functions. We can access the docstring of the printMax function using the __doc__ (notice the double underscores) attribute (name belonging to) of the function. Just remember that Python treats everything as an object and this includes functions. We'll learn more about objects in the chapter on classes.
We'll learn more about objects in the chapter on classes. If you have used help() in Python, then you have already seen the usage of docstrings! What it does is just fetch the __doc__ attribute of that function and displays it in a neat manner for you. You can try it out on the function above - just include help(printMax) in 53 Python en:Functions your program. Remember to press the q key to exit help. Automated tools can retrieve the documentation from your program in this manner. Therefore, I strongly recommend that you use docstrings for any non-trivial function that you write.
A Byte of Python 1.92 by Swaroop C. H.