explainations about standard library and modules in Python.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hung ho

    explainations about standard library and modules in Python.

    Hi.
    I just finished reading an introductory Python book called "Python Programming for the absolute beginner" by Michael Dawson. I found it very interesting, and easy to follow. Python does really look similar to C/C++ and Java. In the book, the author imported other modules that were from the standard library of Python. I tried reading some of the modules in the standard library in Python's Lib folder. I'm just a beginner to Python, and didn't understand anything in any of the modules.
    My question is that, can anyone recommend me any book, or online materials that could explain what the functions some of the modules in the standard library can do that are packaged along with Python v. 2.3.4?. For example, I read some modules such as os.py, sys.py, and random.py The documents in those modules didn't help me to comprehend what the purpose of the modules, and how to use them in Python. What are their functions, and how do I use them.
    Thank You.
  • Peter Hansen

    #2
    Re: explainations about standard library and modules in Python.

    Hung ho wrote:
    [color=blue]
    > My question is that, can anyone recommend me any book, or online materials that
    > could explain what the functions some of the modules in the standard
    > library can do that are packaged along with Python v. 2.3.4?. For
    > example, I read some modules such as os.py, sys.py, and random.py
    > The documents in those modules didn't help me to comprehend what
    > the purpose of the modules, and how to use them in Python.[/color]

    No beginner is expected to read the source code itself to figure
    things out. Go to the online documentation at http://docs.python.org
    and browse through it. Make sure you read the tutorial, but if
    you have questions about specific modules, go to the Global Module
    Index.

    For example, read the first sentence of each of these two learn the
    purpose of the modules you mentioned:

    This module provides access to some variables used or maintained by the interpreter and to functions that interact strongly with the interpreter. It is always available. Unless explicitly noted oth...

    Source code: Lib/os.py This module provides a portable way of using operating system dependent functionality. If you just want to read or write a file see open(), if you want to manipulate paths, s...

    Source code: Lib/random.py This module implements pseudo-random number generators for various distributions. For integers, there is uniform selection from a range. For sequences, there is uniform s...


    -Peter

    Comment

    • Trent Mick

      #3
      Re: explainations about standard library and modules in Python.

      [Hung ho wrote][color=blue]
      > My question is that, can anyone recommend me any book, or online
      > materials that could explain what the functions some of the modules in
      > the standard library can do that are packaged along with Python v.
      > 2.3.4?. For example, I read some modules such as os.py, sys.py, and
      > random.py The documents in those modules didn't help me to comprehend
      > what the purpose of the modules, and how to use them in Python. What
      > are their functions, and how do I use them. Thank You.[/color]



      Specifically:
      Source code: Lib/os.py This module provides a portable way of using operating system dependent functionality. If you just want to read or write a file see open(), if you want to manipulate paths, s...

      This module provides access to some variables used or maintained by the interpreter and to functions that interact strongly with the interpreter. It is always available. Unless explicitly noted oth...

      Source code: Lib/random.py This module implements pseudo-random number generators for various distributions. For integers, there is uniform selection from a range. For sequences, there is uniform s...


      Cheers,
      Trent

      --
      Trent Mick
      TrentM@ActiveSt ate.com

      Comment

      • Colin J. Williams

        #4
        Re: explainations about standard library and modules in Python.


        Hung ho wrote:[color=blue]
        > Hi.
        > I just finished reading an introductory Python book called "Python Programming for the absolute beginner" by Michael Dawson. I found it very interesting, and easy to follow. Python does really look similar to C/C++ and Java. In the book, the author imported other modules that were from the standard library of Python. I tried reading some of the modules in the standard library in Python's Lib folder. I'm just a beginner to Python, and didn't understand anything in any of the modules.
        > My question is that, can anyone recommend me any book, or online materials that could explain what the functions some of the modules in the standard library can do that are packaged along with Python v. 2.3.4?. For example, I read some modules such as os.py, sys.py, and random.py The documents in those modules didn't help me to comprehend what the purpose of the modules, and how to use them in Python. What are their functions, and how do I use them.
        > Thank You.[/color]

        For someone who has previous programming experience, Alex Martelli's
        Python in a Nutshell is an excellent reference.

        Colin W.

        Comment

        • Porky Pig Jr

          #5
          Re: explainations about standard library and modules in Python.

          "Hung ho" <hung ho@rogers.com> wrote in message news:<URJZc.172 448$UTP.96931@t wister01.bloor. is.net.cable.ro gers.com>...[color=blue]
          > My question is that, can anyone recommend me any book, or online
          > materials that could explain what the functions some of the modules in
          > the standard library can do that are packaged along with Python v.
          > 2.3.4?. For example, I read some modules such as os.py, sys.py, and
          > random.py The documents in those modules didn't help me to comprehend
          > what the purpose of the modules, and how to use them in Python. What are
          > their functions, and how do I use them.
          > Thank You.[/color]

          Python in a Nutshell has a nice concise converage of key functions of
          a built-in modules including both os.py and sys.py. 'Programming
          Python' goes into greater details, gives lots of coding examples.

          I agree on-line information you can retrieve with 'help' can be rather
          confusing. Doing something like

          help(random)

          got me lost in the forest, not seeing the trees. Once again, Python in
          a Nutshell has a nice page on random module with a list and short
          explanation of key functions. Granted, it mostly duplicates the staff
          from help(random), but it lists only those you really need to know to
          start using random.

          Comment

          • Brian van den Broek

            #6
            Re: explainations about standard library and modules in Python.

            Hung ho said unto the world upon 2004-09-02 14:44:[color=blue]
            > Hi. I just finished reading an introductory Python book called "Python
            > Programming for the absolute beginner" by Michael Dawson. I found it
            > very interesting, and easy to follow. Python does really look similar
            > to C/C++ and Java. In the book, the author imported other modules that
            > were from the standard library of Python. I tried reading some of the
            > modules in the standard library in Python's Lib folder. I'm just a
            > beginner to Python, and didn't understand anything in any of the
            > modules. My question is that, can anyone recommend me any book, or
            > online materials that could explain what the functions some of the
            > modules in the standard library can do that are packaged along with
            > Python v. 2.3.4?. For example, I read some modules such as os.py,
            > sys.py, and random.py The documents in those modules didn't help me to
            > comprehend what the purpose of the modules, and how to use them in
            > Python. What are their functions, and how do I use them. Thank You.[/color]

            Hi,

            I am a relative newcomer to Python and programming both.

            You've already been pointed to Python in a Nutshell. I'll add my voice to
            that.

            I'd also suggest The Python Standard library by Lundh. There is an
            O'Reilly dead-tree <http://www.oreilly.com/catalog/pythonsl/> and a free
            version at <http://effbot.org/zone/librarybook-index.htm>. It is a bit out
            of date (IIRC it is geared to Python 2.0), but it has been helpful to me
            nevertheless.

            Between the docs, the Nutshell book and the Lundh, the helpful people on
            the tutor list have been spared many posts from me ;-)

            Best,

            Brian vdB

            Comment

            • Alex Martelli

              #7
              Re: explainations about standard library and modules in Python.

              Colin J. Williams <cjw@sympatico. ca> wrote:
              ...[color=blue][color=green]
              > > My question is that, can anyone recommend me any book, or online[/color][/color]
              materials that could explain what the functions some of the modules in
              the standard library can do that are packaged along with Python v.
              2.3.4?. For
              ...[color=blue]
              > For someone who has previous programming experience, Alex Martelli's
              > Python in a Nutshell is an excellent reference.[/color]

              Thanks Colin, your usual agent's fee will be forthcoming of course (now
              wouldn't be funny if I mistakenly posted this to the whole list instead
              of privately to you, ha ha, no chance of course I'd so such a mistake!).


              Alex

              Comment

              Working...