How does python work

Discussion in 'Python' started by Geiregat Jonas, Jul 10, 2003.

  1. I'm asking myself how Python code get's executed ...
    What happens first etc ...
    First read the file and then ..
    How python handle's variable internally ...
    also could someone point me to the build in functions in the python source
    code ?
     
    Geiregat Jonas, Jul 10, 2003
    #1
    1. Advertising

  2. On Thu, 10 Jul 2003 13:05:07 +0200,
    Geiregat Jonas <> wrote:
    > I'm asking myself how Python code get's executed ...
    > What happens first etc ...
    > First read the file and then ..


    The code is parsed and compiled into bytecode that can then be executed.
    Consult a textbook on parsing or programming language implementation for
    more details about how parsing is done.

    I thought someone (MWH?) wrote an explanation of Python's internals once,
    but can't find anything at the moment. The Python docs have some relevant
    material (http://www.python.org/doc/current/ext/ext.html), but that document
    doesn't concentrate on the implementation details, just on the bits you can
    easily access from extensions.

    > also could someone point me to the build in functions in the python source
    > code ?


    They're in Python/bltinmodule.c.

    --amk
    OTHELLO: Once more, well met at Cyprus!
    -- _Othello_, II, i
     
    A.M. Kuchling, Jul 10, 2003
    #2
    1. Advertising

  3. Geiregat Jonas

    Peter Scott Guest

    "Geiregat Jonas" <> wrote in message news:<>...
    > I'm asking myself how Python code get's executed ...
    > What happens first etc ...
    > First read the file and then ..
    > How python handle's variable internally ...
    > also could someone point me to the build in functions in the python source
    > code ?


    The Python Library Reference has a section on "Built-in Functions,
    Types, and Exceptions" at
    <http://www.python.org/doc/current/lib/builtin.html>. There is also a
    section documenting some rather low level internal modules at
    <http://www.python.org/doc/current/lib/language.html>, such as parser,
    which lets you access the parse tree, and dis, a disassembler for
    python bytecode.

    -Peter
     
    Peter Scott, Jul 10, 2003
    #3
  4. "A.M. Kuchling" <> writes:

    > On Thu, 10 Jul 2003 13:05:07 +0200,
    > Geiregat Jonas <> wrote:
    > > I'm asking myself how Python code get's executed ...
    > > What happens first etc ...
    > > First read the file and then ..

    >
    > The code is parsed and compiled into bytecode that can then be executed.
    > Consult a textbook on parsing or programming language implementation for
    > more details about how parsing is done.
    >
    > I thought someone (MWH?) wrote an explanation of Python's internals once,
    > but can't find anything at the moment.


    I've threatened to do it, but not actually done it.

    If you can read C, these things aren't that hard to figure out (though
    tags or cscope certainly help...).

    Cheers,
    M.

    --
    You owe the Oracle a star-spangled dunce cap.
    -- Internet Oracularity Internet Oracularity #1299-08
     
    Michael Hudson, Jul 16, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TB
    Replies:
    2
    Views:
    3,743
  2. Alek Nazarian
    Replies:
    7
    Views:
    3,232
    Alek Nazarian
    Oct 22, 2003
  3. Nick L
    Replies:
    10
    Views:
    596
    Jerry Coffin
    Aug 31, 2004
  4. Vineet Jain
    Replies:
    9
    Views:
    447
    Fredrik Lundh
    Apr 16, 2004
  5. jblazi
    Replies:
    5
    Views:
    435
    jblazi
    Aug 16, 2004
Loading...

Share This Page